Beruflich Dokumente
Kultur Dokumente
2
s would like to thnk to the following people for their support during the projet developmentX
Andre Cunha (Brazil) for review of this doument Kara Blackowiak (USA) for ertin ode reviews Kostya V. Ivanov (Russia) for ug (xes in the simultor engineF Shakthi Kannan (India) for dding this softwre to the piv projet
nd for few pthesF
Miroslav Hradlek (EU) for ug reports nd suggestions Fabricio Alcalde (Argentina) for suggestions nd ug reportsF Francisco Albani (Argentina) for suggestions nd few ug reportsF
Contents
Preface
qols of the projet F F F F F F F F F F F F F F F F F F F F F F F F F F F equirements F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F sntended eudiene F F F F F F F F F F F F F F F F F F F F F F F F F F F IFI IFP IFQ PFI PFP QFI
S T U
1 Brief introduction
win omponents of wg VHSI shi F F F F F F F F F F F F F F W ht is wgESI F F F F F F F F F F F F F F F F F F F F F F F F F IP ht is the essemly lnguge F F F F F F F F F F F F F F F F F IP hemonstrtion projet F F F F F F F F F F F F F F F F F F F F F F IS our (rst projet in wg VHSI shi F F F F F F F F F F F F F F IT F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F
2 Quick start
15
QFP
QFQ
oure ode editor F F F F F F F F F F F F QFIFI yntx highlight nd vlidtion F QFIFP pell heking F F F F F F F F F F F QFIFQ eutoEompletion F F F F F F F F F QFIFR iditor ommnd line F F F F F F F fottom pnel F F F F F F F F F F F F F F F QFPFI win pnel of the wg simultor QFPFP g vriles F F F F F F F F F F F F QFPFQ qrph showing voltge levels F F F QFPFR wessges pnel F F F F F F F F F F QFPFS xotes F F F F F F F F F F F F F F F QFPFT glultor F F F F F F F F F F F F F QFPFU pind in (les F F F F F F F F F F F F QFPFV erminl emultor F F F F F F F F veft pnel F F F F F F F F F F F F F F F F F QFQFI vist of opened (les F F F F F F F F
17
IU IU IU IV IV PH PH PH PI PI PP PP PQ PQ PR PR
4
QFQFP vist of projet (les F F F F F F F F F F F F F QFQFQ p wthes F F F F F F F F F F F F F F F F QFQFR pile system rowser F F F F F F F F F F F F F ight pnel F F F F F F F F F F F F F F F F F F F F F QFRFI vist of ookmrks F F F F F F F F F F F F F F QFRFP vist of rekpoints F F F F F F F F F F F F F QFRFQ snstrution detils F F F F F F F F F F F F F QFRFR ht register wthes F F F F F F F F F F F F QFRFS uprogrms ll monitor F F F F F F F F F QFRFT vist of symols F F F F F F F F F F F F F F F QFRFU r plugEins mnger F F F F F F F F F F F yther tools F F F F F F F F F F F F F F F F F F F F F QFSFI p mp F F F F F F F F F F F F F F F F F F QFSFP wp of it ddressle re F F F F F F F F QFSFQ tk monitor F F F F F F F F F F F F F F F F QFSFR ymol viewer F F F F F F F F F F F F F F F F QFSFS egss hrt F F F F F F F F F F F F F F F F F QFSFT VHSI snstrution le F F F F F F F F F F F QFSFU VEsegment editor F F F F F F F F F F F F F F QFSFV topwth F F F F F F F F F F F F F F F F F F QFSFW rile notepd F F F F F F F F F F F F F F QFSFIH fse onverter F F F F F F F F F F F F F F F QFSFII EPQP deugger F F F F F F F F F F F F F F QFSFIP rexdeiml editors F F F F F F F F F F F F QFSFIQ rierntion of simulted progrm F F F F F QFSFIR snterrupt monitor F F F F F F F F F F F F F F QFSFIS gonversions etween BFhexD BFin nd BFdf QFSFIT xormliztion of soure ode indenttion F QFSFIU ghnge letter se F F F F F F F F F F F F F QFSFIV ser de(ned ommnds F F F F F F F F F F QFSFIW glenEup projet folder F F F F F F F F F F F QFSFPH pile sttisti F F F F F F F F F F F F F F F F F gon(gurtion dilogues F F F F F F F F F F F F F F F ttements F F F F F F F F F F F ymols F F F F F F F F F F F F gonstnts F F F F F F F F F F F ixpressions F F F F F F F F F F he instrution set proessing essemler diretives F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F
CONTENTS
F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F (les F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F PR PR PR PR PR PS PS PS PT PT PT PU PU PU PU PV PW PW PW PW PW QH QH QI QP QP QQ QQ QQ QR QS QS QS
QFR
QFS
4 Build-in macro-assembler
39
QW QW RH RI RP RQ
CONTENTS
RFU RFV RFW RFIH RFII RFIP RFIQ RFIR RFIS essemler gontrols F F F F F F F F F F rede(ned ymols F F F F F F F F F F egment type F F F F F F F F F F F F F gonditionl essemly F F F F F F F F F wro roessing F F F F F F F F F F F eserved keywords F F F F F F F F F F gomptiility with eiwESI F F F F vist pile pormt F F F F F F F F F F F F pei(tion of sntel R V ri pormt F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F
5
RU RW SI SQ SR SV SW TH TP
63 65
TS TS TT TT TU TU TU TV TV TV TW TW UH UH UI UP UQ UR US
71
8 Command Line Interface 9 Translating the IDE into dierent languages A License
77 79 81
6 B Regression testing
CONTENTS
fFI poreword F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F VQ fFP wore out the implementtion F F F F F F F F F F F F F F F F F VQ
83
85
D 8051 Instructions in numerical Order E 8051 Instructions in alphabetical order F List of supported micro-controllers G Change log
87 93 99
101
Preface
Goals of the project
wg VHSI shi is n integrted development environment for miroonE trollers sed on wgESI intended for essemly lnguge nd g lngugeF R his shi is urrently ville on qxGvinux nd wirosoft R indows @sine version IFQFTAF his progrm ws originlly intended for edution purposesD ut now the re of potentil usge is surely signi(ntly widerF his progrm ws reted to (ll gp in the open soure softwre of this kindF ser interfeD soure odesD doumenttionD we pgesD etFD re writE ten in inglish in order to mke this softwre ville to s mny user s possileD ut there is support for interntionliztion using iIVn sine verE A sion IFQFIHF his doumenttion is written in v iF st is very importnt to note tht this softwre ws not developed for ny ompnyD person or something similr nd it is ompletely nonommerilD open soure softwre distriuted under qx qvvP liense intended for group of people with ommon interestD in this se VHSIF
CONTENTS
snterfe for hrdwre tool ontrol plugEinsY ienti( lultor nd speil lultor optimized for VHSIF
Requirements
rrdwre requirements re not de(nedF his progrm should run without prolems on ll ys systems @like qxGvinuxD etFAD where ll of the softwre dependenies were stis(edF he shi is o0illy distriuted s soure ode pkge @primry progrmming lnguge is gvAD w pkge @urrently ville in o0il riv repositoriesAD hif pkge @urrently ville in o0il hein repositoriesA nd euild for qentoo vinux @urE rently xy ville in the portge treeAF
Package Min. version Required packages:
tcl tk bwidget itcl tdom tkimg tcllib Tclx cmake rxvt-unicode asem-51 sdcc doxygen indent hunspell bash gawk 8.5 8.5 1.8 3.4 0.8 1.3 1.6 8.4 2.6 8.3 1.3 2.9 1.3 1.2 1.2 4.0 3.1
Download location
(The IDE will not run without these packages)
Optional packages:
http://tclx.sourceforge.net http://www.cmake.org/HTML/Download.html ./configure && make && make install) http://software.schmorp.de http://plit.de/asem-51/download.htm http://sdcc.sourceforge.net/ www.doxygen.org/
(Signal handling (signals like SIGINT) (If you prefer this way of installation: (If you want terminal emulator)
(If you want to use a really good assembler :) ) (If you want to used C language compiler)
http://www.gnu.org/software/indent/ http://hunspell.sourceforge.net
(If you want to use auto-indent function for C language) (If you want to have spell checker function available) (If you want to have spell checker function available) (If you want to have spell checker function available)
Table 1: Software requirements
http://tiswww.case.edu/php/chet/bash/bashtop.html http://www.gnu.org/software/gawk/
CONTENTS
Intended Audience
his mnul is intended for ny individulD regrdless of his or her experiene with ssemlerD g lngugeD wg VHSI shi or vinuxD ut it is ssumed here tht the reder is fmilir with si onepts of ssemly lnguge progrmE ming nd with VHSI proessor rhitetureF edvned users re not likely to red this mnulD ut ll suggestions on doumenttion will e onsideredF sf you would like to ontriute to this projet or the doumenttionD plese onsult the projet we pgeF hnks for your oopertion whih helps to mke this softwre etterF
10
CONTENTS
11
Editor
Assembler he ssemler is one of the integrl prts of wg VHSI shiF st is mro ssemler with support for dozens of diretives nd ple of perE forming peephole optimiztionsF upport for peephole optimiztions mens tht the ssemler n ttempt to optimize the resulting ode for higher exeE ution speed nd lower size without tempering with its very funtionlityF st is importnt to note tht utomti peephole optimiztion n sometimes e hrmful nd so it is disled y defultF e mro ssemler is softwre tht llows the user to de(ne macro instructionD whih onsists of sequene
1 Spell checking for comments is available only if you have installed the Hunspell program. This feature is currently not available on MS R Windows R OS.
12
of si instrutionsD nd use it lter insted of repetedly opying nd pstE ing the set of instrutions over nd over long the soure odeF essemler ehvior n e on(gured either glollyD using the proper on(gurtion diE logD or lolly in soure odeD y mens of ssemler diretives nd ontrol sequenes @eFgF $TITLE('Some title to show in the code listing')AF he ssemler is ple of generting four kinds of output odeX
yjet ode @mhine odeA s n hexdeiml (leD with .hex extension nd in sntel R V ri formtY yjet ode @mhine odeA s inry (leD with .bin extension nd in formt of rw inry dtY gode listingD in .lst extensionY gode for integrted wg simultorD in .adf extensionF
he simultor is softwre omponent intended for the simuE ltion of the hosen miroontroller in virtul environmentF st llows user to monitor preisely wht is hppening in the wg in n ext moment in timeD s well s to modify its omponentsD for instne y ltering the vlue of registerD neling n interrupt or foring suprogrm to returnF sn tht wy it might e possile to ferret out ertin )ws in the progrm eE ing deuggedD whih would e hrd or nerly impossile to (nd ndGor (x in other wysF iven though it is etter to hve sgh @snEgiruit heuggerA or sgi @snEgiruit imultorA t hndD wg VHSI shi in urrent version does not support neither of them wg simultor implemented in this shi supports dozens of miroontrollers nd most of them re treted in slightly di'erent wy llowing to tke into ount most of the nunes etween the supported wgsF ser n djust simultor ehvior to (t his or her needs y modifying lok frequenyD size of onneted externl odeD dt memory nd othersD or for instne y disling or enling ertin wrningsD whih pops up when the simulted progrm do something strngeD like some kind of invlid ess into memory or stk over)ow or under)owF fesides thtD it is possile for the user to modify ll registers whih the wg dels withD inluding those whih re not essile y the running progrmD like the rogrm gounterF ser hve lwys n overview of ll possileD pending nd tive interrupts nd n temper with them t ny timeF he simultor lso llows for ltering ode memory nd ll kinds of dt memoriesF he proE grm eing simulted n e t ny time 4hiernted4 into (leD preferly with .m5ihib extensionD nd resumed lter from this sme (leF uh (le ontins the entire stte of the simultor t the point in whih the progrm ws hierntedF
Simulator
13
Project management st is funtionlity tht llows the shi to rememE er ertin set of soure ode (les long with set of on(gurtion prmE etersF rojets re stored in wv @etensile wrkup vngugeA (les with extension .mcu8051ideF hese (les re humn redle nd their preise formtting is desried in their inline hh @houment ype helrtionAF heir enoding is pEV @niode rnsformtionA nd s iyv @ind yf vineA hrter they use vp @vine peedAF he reson for tht is to mke it possile for the user to implement his or her own tools for mnipulting with themF Scientic calculator
wg VHSI shi sienti( lultor is implemented s simple sienti( lultor ple of omputtion in four numer sysE temsX hexdeimlD deimlD otl nd inryD nd with three ngle unitsX rdinsD degrees nd grdF sntegrl prt of the lultor is lso simple tool intended solely for omputing preset vlues for wg timersF
Special calculator
he experiene in wg progrmming shows tht it is very useful to hve some tools t hndD ple of performing reurrent oring lultions tht spend time to e done y hndF wg VHSI shi speil lultor is intended for performing ertin simple speilized luE ltions relted to VHSIF por instneD this lultor is ple of generting ssemly lnguge ode implementing wit loop with spei(ed prmetersF his utility is used here for wthing nd modifying lrge loks of rw dt in vrious memory types of the simulted wg @godeD sheeD heeD iiywD etFAF here is lso hexdeiml editor intended for editing sntel R ri V (lesF yther hexdeiml editors re speilly designed to (t spei( needs of the given purposeY for exmpleD there is n hexdeiml editor for viewing nd editing ode memoryD whih displys the urrent position of the progrm ounter in the mhine ode of the simulted progrmF his tool n trnslte one ssemled ode k to soure odeF st is importnt to note tht it is somewht improle tht the resultE ing soure ode will look 4resonle4 st is due to DB nd DW nd not (xed instrution word length on VHSIF xeverthelessD suh generted soure ode must posses extly the sme funtionlity when it gets ssemled ginF hisssemler implemented in this shi is frnkly speking only little more tht just toyF sf you wnt relly ple disssemlerD mye you should try some tool like hSP http://www.8052.com/users/disasm/F
Hexadecimal editor
Disassembler
14
Notepad sn this shiD it is simple rih text editor for writing user notes of whtever kindF yriginllyD it ws intended for writing list of things whih remin to e done in your projetF Command Line Interface (CLI)
st is n useful tool tht llows the use of some shi funtions without entering it9s qsF ou n get list of ville options y typing mcu8051ide -h or mcu8051ide help to your terminl emultorF ou nD for exmpleD use just the ssemler of the shi or onvert n sntel R ri V (le to rw inry (leF
15
16
17
Figure 2.1: MCU 8051 IDE with the demonstration project opened within it
18
19
20
here is lso on(gurle spell heking funtion vilE leF st underlines words whih re mrked y runE spell1 s inorretly spelledF his funtion pplies to omments in the ode or the entire ode in se tht Figure 3.2: Spell the syntx highlight funtion hs een disledF ser checker conguration n hoose from ny of runspell or wyspell ditionrE button ies instlled on his or her systemF his feture n lso e turned o'F st mkes sense tht this funtion is ompletely dependent on the runspell progrmD if it is not instlledD spell heking won9t work hereF
3.1.3 Auto-completion
opEup sed utoEompletion is funE tion whih should mke it esier to use long nmes for lelsD mrosD vriE lesD funtionsD onstntsD etF his funtion is interonneted with syntx editor9s nlyzer used for syntx highE light nd vlidtion nd for the tle of symols in the right pnelF o it minE tins n overview of ll symols de(ned Figure 3.3: Syntax highlight, syntax in your soure ode (le nd then when validation and the pop-up based autocompletion all in action you write just few hrters whih symol strts withD this funtion will popEup window o'ering you ll de(ned symols eginning with tht lettersF xote tht this feture n e disled in editor on(gurtion dilog nd note lso tht esides symols it o'ers lso list of ssemly lnguge instrution mnemonis nd ssemler diretivesF
http://hunspell.
21
ommnd y running ommnd help listF gommnd line is fetured with its own olor highlightD history nd utoEompletionF
d2h d2o d2b h2d h2o h2b o2h o2d o2b b2h b2d b2o animate assemble auto-indent bookmark breakpoint capitalize clear comment copy custom cut date exit exit-program find goto help char indent kill-line open paste redo reload replace run save set-icon-border set-line-numbers sim step tolower toupper uncomment undo unindent hibernate resume switch-mcu set-xcode set-xdata
Command
Arguments
<decimal number> <decimal number> <decimal number> <hexadecimal number> <hexadecimal number> <hexadecimal number> <octal number> <octal number> <octal number> <binary number> <binary number> <binary number>
Description
Convert decimal number into hexadecimal Convert decimal number into octal Convert decimal number into binary Convert hexadecimal number into decimal Convert hexadecimal number into octal Convert hexadecimal number into binary Convert octal number into hexadecimal Convert octal number into decimal Convert octal number into binary Convert binary number into hexadecimal Convert binary number into decimal Convert binary number into octal Animate simulated program Run assembler Automatically indent the edited code Create or delete bookmark on the current line Create or delete breakpoint on the current line Capitalize selected text Clear history Comment selection Copy selection
Run user command Cut selection Insert current time and/or date Leave command line Exit the IDE
Find a string Go to the specied line Display help for the specied command Insert a character Indent selection Delete current line
<le name>
Open the specied le Paste text from clipboard Take back last undo Reload current document
<string> <replacement>
Replace a string with another string Run simulator in animation mode Save the current le Show/Hide icon border Show/Hide line numbers Engage/Disengage simulator Step simulated program Convert selected text to lowercase Convert selected text to uppercase Comment current line Undo the last text editing operation Decrease indentation level of the current line
[<target le>] [<source le>] <MCU name> <size of XCODE mem.> <size of XDATA mem.>
Hibernate simulated program Resume hibernated program Switch current MCU simulation mode to another MCU Set size external data memory for simulated MCU Set size external program memory for simulated MCU
22
Representa-
Highlighted Figure 3.6: Tool tip help tion of a register value in for a special function bit various numeric bases
SFR register
3.2.2 C variables
his pnel is prt of simultor user interfe tht mintins list of glol stti vriles de(ned in your g lnguge odeF xmes of vriles re displyed long with their urrent vlues in simulted wgF sf you progrm is not written in g lnguge then this tool hs no purpose for you t llF ytherwise the purpose of this pnel is to mke it esier to simulte progrm for VHSI written in g lnguge nd see wht is relly hppening in thereF his tool is ple of extrting vrile vlues from multiple registers nd the displying them s one vrileD one vlueF eltertion of vrile vlues is lso possileF end serh pnel in the top right orner of the pnel might
23
help you with (nding ext vrile whih you need to seeF fut note tht funtionlity of this tool is in ft severely limitedD it supports only glol stti vrilesD integers nd )otsD ut vrile vlue modi(tion is llowed only for integer vrilesD no )otsF
24
3.2.5 Notes
his is your personl notes for whtever you wntF yriginlly it ws intended for writing down list of things whih you need to (nish in your workD so some sort of to do listF fut it is just simple rih text editor with seprte (le spei( notepdF ser n use it s he or she onsider ppropriteF
3.2.6 Calculator
glultor is here more or less just for ompletenessF fut you might still (nd it to rel sset to your e'ortsF his lultor is ple of performing ommon rithmetil opertionsD omputing trigonometri funtionsD logiE l opertionsD etF upported numerl systems re hexdeimlD deimlD otl nd inry in oth integer nd rel numersF upported ngulr meE surement units re degreesD rdins nd grdinsF he lultor is lso equipped with three memory ells where you n sve ritrry numers for future omputtionsF yn the right side there is simple lultor dedited to lultion timers preset vlues for the spei(ed timeD lok frequenyD etF
3
3 Essentially the same but much more advanced function has also the special calculator.
25
Figure 3.12: Embedded rxvt-unicode terminal emulator, with the Midnight Commander
running in it
4 An instance of pattern matching behavior, for example *.c++ matches all les with
.c++ extension.
5 A command line text search utility originally written for Unix. The name is taken
from the rst letters in global/regular expression/print. Its ocial date of creation is given as March 3, 1973.
6 A video terminal that was made by Digital Equipment Corporation (DEC). Its detailed 7 Computer software system and network protocol that provides a basis for graphical
attributes became the de facto standard for terminal emulators. user interfaces.
26
his pnel should help you quikly nvigte in your (le system in order to open (les you wnt to see s quikly s possileF fut mny people generlly don9t like pnels like this nd will lE wys use only (le seletion dilog instedF
27
to the urrent line @line with ursorA in the soure ode editorF ou n lso remove ll ookmrks t one y pressing the gler ll uttonF
Instruction details
Figure 3.15:
Data register
watches
28
ols from ode listing (le8 generted y n sE semlerF his feture n enled or disled in the pnel9s on(gurtion menuF he urrent list of wthed registers n e sved into (le nd loded from (le9 F wemory segments re distinguished y formt of the ddressesF es you n seen in the exmpleD the mening is thisX
Address format
1 or 2 digits 3 digits 4 digits dot and 2 digits
Memory segment
Internal RAM (not SFR) Expanded RAM External RAM Bit (including SFR area)
.lst
.wtc
29
with ertin hrdwre toolsD most proly wg progrmmersF if you re interested in writing these plugEinsD plese refer to hpter UF
Figure 3.17:
dressable area
monitor
30
sesD hexdeimlD deimlD inry nd otl nd lso s hrter ording to egss hrtF xewly dded vlues re pushed on the top of the listF end their origins re distinguished y kground olor of the ddressF hese olors re explined in the legend on ottomF xote tht utton gler doe not ler the stk ut insted it ler only the monitor3 futtons y nd r re intended for mnipultion with the stk9s ontentF
31
3.5.8 Stopwatch
topwth is tool whih n mesure ertin things in the simulted proesE sorD suh s numer of instrutions proessed so frD numer of miroseonds whih would it tke for rel proessor to exeuteD numer of rekpoints met so fr etF ser n lso set it to stop the simultion when ertin limit in the mesurement hs een met or exeededF
32
DCE
33
where the reeived dt will e writtenF end y utton end seleted you n trigger trnsmission over the opened physil portD seleted hunk of the dt will e send thenF futton gler seleted re intended for removing dt from the hexdeiml editors editorsF
llows user to see nd modify ontents of the gyhi memory of the simulted miroEontrollerF peil feture of this prtiulr editor is tht instrution y ode urrently pointed y progrm ounter @gA is highlighted with drk ornge kground long with the instrution9s operndsF end the sme pplies lso for the previously exeuted instrution ut highlight olor is light ornge in this seF
MCU data/xdata/eeprom memory editor llows user to see nd modE ify ontents of the sheeGheeGiiyw memory of the simulted miroEontrollerF peil fetures of this editors re tht reently hnged otets re highlighted with light ornge foreground olor nd otets urrently eing written into the memory re highlighted with gry kground olorF MCU eeprom write buer editor
llows to see nd modify iiyw write u'erF gurrent iiyw write o'set is displyed s wellF
34
is universl hexdeiml editor with mximum pity of TRkf nd support for sntel R V ri (le formtF his tool is ompletely independent from your projet in the shiF his too might e prtiulrly useful when you wnt to nd possily modify ontent of sntel R V hex (leD ut do not lter the simulted wgF
35
HEX BIN gonvert sntel R V rex (le to rw inry (le BIN HEX gonvert rw inry (le to sntel R V rex SIM HEX gonvert simultor ssemler deug (le @.adfA to sntel R V rex (le SIM BIN gonvert simultor ssemler deug (le @.adfA to rw inry (le Normalize Hex ed nd rewrite the given sntel R V rex (leD so tht ll reords stis(es spei(ed mximum length @n e set in the ssemler on(gurtion dilogAD ll reords re in inrementl order nd no reords overlps with othersF
Original code:
abc DATA 7Fh ; Start at address 0x00 ORG 0h label0:inc R0 inc @R0 cjne R0 , #abc ,label0 mov R0, #0h sjmp label0 ; End of assembly END
DATA 7Fh ; Start at address 0x00 ORG 0h label0: inc R0 inc @R0 cjne R0, #abc, label0 mov R0, #0h sjmp label0 ; End of assembly END
36
his tool n hnge letter sing to upper or lower se of ertin types tokens whih your soure onsists of ofF por exmple you n esily onvert ll instrution mnemonis in the ode to upperseF st is intended for users who stritly prefers one or nother onE vention of letter sing in ssemly lngugeF ou n invoke the tool from Main Menu Tools Change letter caseF
Figure 3.27:
dialog
Introduction
Meaning
The full URL of the current le List of the URLs of all open documents Project directory The le name of the current document Same as %lename, but without extension Name of project main le Number of the current line Number of the current column The selected text in the current le The full text of the current le
Conguration
ommndsF
37
Execution
efter the sript is exeuted suE essfully or notD dilog showing the results will pper upon ompletion of the sriptF his dilog ontins ll textul output from the sript ught on stndrd output nd stndrd error outputF sf the sript outputs nything to the stndrd error output it is onsidered unsuessfulF
conguration dialog
his tool n proof useful prtiulrly when your projet diretory gets polluted with lots of unneessry (lesD nd you wnt to get rid of them esily nd (rst of ll sfelyF st removes (les with ertin (le nme extensions from the projet folderF he list of removed (les is then written in results dilogF eville from Main Menu Tools Clean up project folderF
Editor conguration
sn editor on(gurtion dilog user n hnge preferred editor from defult uiltEin editor to for exmple im or ims nd modify on(gE urtion the uiltEin editorF gon(gurle re olors used for syntx highlightD olors for text re kground nd so onD font used y editorD indenttion modeD utoE sve intervl nd othersF
Figure 3.29:
Editor
conguration dialog
38
Compiler conguration gompiler on(gurtion diE log llows user to on(gure ehvior of the uiltEin ssemlerD hose nother ssemler insted of this oneF gon(gure the preferred ssemler nd on(gure the g ompiler @hggAF gompiler on(gurtion is stored in the projet (le @the (le with .mcu8051ide extensionAF o these setting re spei( to the one spei( wg VHSI shi projetF gurrently supported externl ssemlers re theseX
eiwESI ev 14 eSI 15
13
row to link multiple (les when using g lngugeX16 IF rite mke(leD PF set the shi to use your mke(le insted of lling the g ompiler diE retly @gon(gurtion Eb gompiler on(gurtion Eb qx mke utilityAD QF strt ompiltion s usulF
Simulator conguration
IF row to tret indeterminle vlues in simultor engine PF row mny steps will e rememered during the simultion for lter kwrd stepsF QF ht wrning onditions will e ignored during the simultion
gon(gures olors used in tools snstrution detils nd egister wthes in the right pnelF
rF
13 A really useful assembler written by W.W. Heinz. You can nd it at 14 Available at http://linux.maruhn.com/sec/asl.html 15 Available at http://www.pjrc.com/tech/8051 16 This feature is not yet supported on MS Windows.
39
gon(gures user de(ned ommndsD whih re essentilly fsh sriptsF his feture is urrently not ville on w R indows R yF
Shortcuts conguration
gon(gures terminl emultor t the ottom pnelF his terminl emultor is emedded rxvtEuniodeF ser n set foreground olor nd kground olor of the terminl emultor window nd the fontF his feture is urrently not ville on w R indows R yF
Global MCU 8051 IDE conguration ghnges settings like qs lngugeD size of fonts used in the qsD qs widget styleD whether splsh sreen should e displyed eh time when the shi is strted nd so onF
Figure 3.31:
Global
conguration dialog
40
41
4.1 Statements
oure ode (les for this ssemler must e text (les where lines re formed like theseX
[ [
label: label:
] ]
instruction
directive directive
[ [
operand
argument
, operand
, operand
]]]
symbol
argument
[ [ [
;comment
;comment ;comment
] ] ]
iverything in squre rkets is optionlF gompiltion does not go eE yond line ontining end diretiveD so fter tht diretive the ode do not hve to e synttilly vlidF impty lines re llowed s well s line ontinE ing only omment or lelF ttements n e seprted y spesD xf hrters2 nd tsF ttements re se insensitive nd their length is not limitedD overll line length is lso not limitedF
4.2 Symbols
ymol nmes for numersD mros or ddresses de(ned y user in the ode using pproprite diretiveF vike with equ diretive you n de(ne new
1 This assembler manual is inspired by ASEM-51 manual, a great work done by W.W.
Heinz
42
start: ; Start mov mov mov mov setb sjmp ; Main loop main: sjmp ; Program end end
; Inifinite loop
symol nd ssign vlue to it right wyF ymols my onsist of upper nd lower se letterD digits nd undersore hrter @AD their length is not limitedD they re se insensitive nd they n e the sme s lnguge keywordsF fe wre of tht there nnot oexists two or more symols in the sme memory segment whih di'ers only y letter singD in other words symols abc nd ABC re ompletely the sme thingF
4.3 Constants
here re two types of onstnts numeri onstnts nd hrter onstntsF xumeri onstnts onsist of sequene of digits llowed for the numeri se used nd followed y the rdix spei(erF sf the numer egins with letterD there must e the zero digit pled efore the numerF por exmple h is not vlid numeri onstntD ut Hh isF ghrter onstnts onE sist of sequene of one or more hrters enlosed y quote hrter @'AF g espe sequenes n e used in hrter onstntsF sf you wnt to ple quote hrter @'A into the onstntD you n either ple two quotes insted of one @ ''''A or espe the quoteD tht mens ple kslsh efore itF here is signi(nt di'erene etween single hrter onstnt nd multiple hrter oneF ingle hrter onstnt is regrded y ssemE ler s V in integer numer nd multiple hrter onstnt is stringD sequene of hrtersF ine version IFRFI it is possile to use pre(x Hx @nd HA s rdix spei(er for hexdeiml numersD so Hxf is the sme s HfhD etF
4.4. EXPRESSIONS
Constant type Binary Octal Decimal Hexadecimal Allowed digits 0 .. 1 0 .. 7 0 .. 9 0 .. 9, A .. F Radix specier B O or Q D or none H
43
4.4 Expressions
erithmetil expressions re evluted t ompiltion time nd repled y ssemler with onstnt orresponding the their resulting vlueF ixpressions omprises of rithmetil opertorsD onstntsD symols nd nother expresE sionsF en exmple of suh expression might e ( X XOR 0FF00H )
Operator NOT HIGH LOW + * / MOD SHL SHR AND OR XOR . EQ, = NE, <> LT, < LE, <= GT, > GE, >=
Unary Operators
Description one's complement high order byte low order byte unsigned addition unsigned subtraction unsigned multiplication unsigned division unsigned remainder logical shift left logical shift right logical and logical or exclusive or bit operator equal to not equal to less than less or equal than greater than greater or equal than
Example NOT 0a55ah HIGH 0a55ah LOW 0a55ah 11 + 12 13 + 11 3 * 5 20 / 4 21 MOD 4 32 SHL 2 32 SHR 2 48 AND 16 370q OR 7 00fh XOR 005h P1.4 11 EQ 11 11 NE 11 11 LT 12 11 LT 11 12 GT 11 12 GT 11
Binary Operators
44
abc EQU ( 2000 * 3 / 100 ) xyz SET ( LOW abc ) IF ( abc > ( 5 MOD 2 ) ) MOV A, # ( ( 15h XOR 12 ) OR xyz ) ELSE ADDC A, # ( HIGH 1234h ) ENDIF
45
ENDM
IFN <expr> IF(2 * 4 - CND) MOV A, #20h ELSE MOV A, #40h ENDIF
if
Example:
IF <expr>
Example:
ifdef
IF DEFined Syntax:
IFDEF <symbol>
Example:
else
ELSE
Example:
ifndef
elseif
IFNDEF <symbol>
Example:
ELSEIF <expr>
Example:
rept
elseifn
REPT <expr>
Example:
ELSEIF <expr>
Example:
times
TIMES <expr>
Example:
elseifdef
Conditional assembly
Syntax:
ELSEIF <expr>
Example:
TIMES 5 NOP
46
elseifndef
Conditional assembly
nolist
Syntax:
ELSEIF <expr>
Example:
NOLIST
Example:
endif
ENDIF
Example:
dseg
DSEG at 20d
iseg
endm
ENDM
Example:
ISEG at 10d
bseg
end
END
Example:
BSEG at 5d
END
xseg
list
LIST
Example:
XSEG at 30d
cseg
47
CSEG at 40d
Example:
ag
data
F4 FLAG 16h
Note: Deprecated directive. Consider directive idata BIT dene instead.} address
ory
skip
SKIP <expr>
Example:
SKIP 5
xdata
equ
EQUivalent Syntax:
macro
bit
local
set
LOCAL
<label>
ds
code
DS <expr>
Example:
48
DS 2+4
dw
DW 0,02009H,2009,4171
db
DB 24,'August',09,(2*8+24)/8
dbit
DBIT <expr>
Example:
DBIT 4+2
include
Syntax:
INCLUDE <filename>
Example:
org
ORG <expr>
Example:
ORG 0Bh
using
USING <expr>
Example:
USING 2
byte
UIV BYTE 20h Note: Deprecated directive. Consider directive DATA instead.
49
Don't list subsequent source lines Syntax:
$NOLI $NOLI
Example:
$DATE(string) $DATE(1965-12-31)
Example:
$nolist
$da
$NOLIST $NOLIST
Example:
$DA(string) $DA(1965-12-31)
Example:
$nomod
$eject
$NOMOD $NOMOD
Example:
$EJECT $EJECT
Example:
$nomo
$ej
$NOMO $NOMO
Example:
$EJ $EJ
Example:
$nomod51
$include
$NOMOD51 $NOMOD51
Syntax:
Example:
$INCLUDE(string) $INCLUDE(somefile.asm)
Example:
$paging
$inc
$PAGING $PAGING
Example:
$INC(string) $INC(somefile.asm)
Example:
$pi
$list
$PI $PI
Example:
$LIST $LIST
Example:
$nopi
$li
$NOPI $NOPI
Example:
$LI $LI
Example:
$nopaging
Syntax:
$NOPAGING
50
Example:
$title
$pagelength
Syntax:
$PAGELENGTH(int) $PAGELENGTH(64)
Example:
$tt
$pl
$PL(int) $PL(64)
Example:
$noobject
Syntax:
$NOOBJECT $NOOBJECT
$pagewidth
Syntax:
$PAGEWIDTH(int) $PAGEWIDTH(132)
Example:
$object
Syntax:
$OBJECT(string) $OBJECT(my_hex.hex)
$pw
$PW(int) $PW(132)
Example:
$PRINT(string) $PRINT(my_list.lst)
$symbols
Syntax:
$SYMBOLS $SYMBOLS
Example:
$noprint
Syntax:
$NOPRINT $NOPRINT
$sb
$SB $SB
Example:
$nomacrosrst
Syntax:
$nosymbols
$NOMACROSFIRST $NOMACROSFIRST
Syntax:
$NOSYMBOLS $NOSYMBOLS
Example:
Example:
$nosb
$NOSB $NOSB
Example:
51
Symbol
RESET TIMER1
Value
000h 01Bh
Symbol
EXTI0 SINT
Value
003h 023h
Symbol
TIMER0 TIMER2
Value
00Bh 02Bh
Symbol
EXTI1 CFINT
Value
013h 033h
Symbol
??MCU_8051_IDE ??VERSION
Value
8051h 0139h
3
Symbol
IT0 TR0 RI REN FE EX0 ES RXD T0 PX0 PS PPCL PT1L TF2 EXEN2 P RS1 CR CCF3
Value
088h 08Ch 098h 09Ch 09Fh 0A8h 0ACh 0B0h 0B4h 0B8h 0BCh 0BEh 0BBh 0CFh 0CBh 0D0h 0D4h 0DEh 0DBh
Symbol
IE0 TF0 TI SM2 ET0 ET2 TXD T1 PT0 PT2 PT2L PX1L EXF2 TR2 OV F0 CCF4 CCF2
Value
089h 08Dh 099h 09Dh 0A9h 0ADh 0B1h 0B5h 0B9h 0BDh 0BDh 0BAh 0CEh 0CAh 0D2h 0D5h 0DCh 0DAh
Symbol
IT1 TR1 RB8 SM1 EX1 EC INT0 WR PX1 PC PSL PT0L RCLK CT2 RS0 AC CCF1
Value
08Ah 08Eh 09Ah 09Eh 0AAh 0AEh 0B2h 0B6h 0BAh 0BEh 0BCh 0B9h 0CDh 0C9h 0D3h 0D6h 0D9h
Symbol
IE1 TF1 TB8 SM0 ET1 EA INT1 RD PT1
Value
08Bh 08Fh 09Bh 09Fh 0ABh 0AFh 0B3h 0B7h 0BBh
52
Symbol
P0 PCON TL1 SCON P3 B DP0H T2CON TL2 CLKREG SADEN AUXR CH CCAP3H CCAPL4H ADDH CCAP0L CCAPL4L CCAPM1 P1M2 P3M1 SPDAT IPH0 KBLS SADEN_1 OSCCON
Value
080h 087h 08Bh 098h 0B0h 0F0h 083h 0C8h 0CCh 08Fh 0B9h 08Eh 0F9h 0FDh 0FEh 0F5h 0EAh 0EEh 0DBh 0E2h 0D5h 0C5h 0B7h 09Ch 0BAh 086h
Symbol
SP TCON TH0 SBUF IP P4 DP0L T2MOD TH2 ACSR SPCR CKCON CCAP0H CCAP4H ADCLK ADCF CCAP1L CCON CCAPM2 P3M2 P4M1 IPL0 BRL KBE SADDR_0 CKRL
Value
081h 088h 08Ch 099h 0B8h 0C0h 082h 0C9h 0CDh 097h 0D5h 08Fh 0FAh 0FEh 0F2h 0F6h 0EBh 0D8h 0DCh 0E3h 0D6h 0B8h 09Ah 09Dh 0A9h 097h
Symbol
DPL TMOD TH1 P2 PSW WDTCON DP1H RCAP2L AUXR1 IPH SPSR WDTPRG CCAP1H CCAPL2H ADCON P5 CCAPL2L CMOD CCAPM3 P4M2 SPCON IPL1 BDRCON KBF SADDR_1 CKCON0
Value
082h 089h 08Dh 0A0h 0D0h 0A7h 085h 0CAh 0A2h 0B7h 0AAh 0A7h 0FBh 0FCh 0F3h 0E8h 0ECh 0D9h 0DDh 0E4h 0C3h 0B2h 09Bh 09Eh 0AAh 08Fh
Symbol
DPH TL0 P1 IE ACC EECON DP1L RCAP2H WDTRST SADDR SPDR CCAP2H CCAPL3H ADDL CL CCAPL3L CCAPM0 CCAPM4 P1M1 SPSTA IPH1 BDRCON_1 SADEN_0 CKSEL
Value
083h 08Ah 090h 0A8h 0E0h 096h 084h 0CBh 0A6h 0A9h 086h 0FCh 0FDh 0F4h 0E9h 0EDh 0DAh 0DEh 0D4h 0C4h 0B3h 09Ch 0B9h 085h
53
hee @segment heeA shee @segment sheeA hee @segment heeA fs @segment fsA gyhi @segment gyhiA iD i @segment xwfiA
DATA segment (internal data memory and SFR) IDATA segment (internal data memory only) XDATA segment (external data memory only) BIT segment (bit addressable area only) CODE segment (program memory only) Segment NUMBER (arbitrary value)
; Segment NUMBER (arbitrary value) MY_G SET MY_A + MY_B + MY_C + MY_D + MY_E + MY_F
54
; CODE segment cseg at my_c CODE word: DW my_cs: DB
; DATA segment dseg at 10q my_d DATA 'd' my_ds: DS 4 ; IDATA segment iseg at 10d my_i IDATA 'i' my_is: DS 4 ; BIT segment bseg at 10b my_bit BIT 'b' my_bs: dbit 4 ; XDATA segment xseg at 10 my_x XDATA 'x' my_xs: DS 4 address equ org 0h
; Start this segment at address 10 octal (8d) ; Define address in internal data memory or SFR area ; Reserve 4 bytes here and set ``my_ds'' to point there ; Start this segment at address 10 decimal ; Define address in internal data memory ; Reserve 4 bytes here and set ``my_is'' to point there ; Start this segment at address 10 binary (2d) ; Define address in bit addressable area ; Reserve 4 bits here and set ``my_bs'' to point there ; Start this segment at address 10 decimal ; Define address in external data memory ; Reserve 4 bytes here and set ``my_xs'' to point there ; Define symbol ``address' in the NUMBER segment
; Clear 1st bit in BIT array ``my_bs'' clr my_bs+1 ; Move 10d to 2nd byte in DATA array ``my_ds'' mov my_ds+2, #10d ; Move 88d to 3rd byte in IDATA array ``my_is'' mov my_is+3, #88d ; Move 55h to 0th byte in XDATA array ``my_xs'' mov A, #55h mov DPTR, #( my_xs + 0 ) movx @DPTR, A ; Read 1st byte from CODE array ``my_cs'' mov DPTR, #my_cs mov A, #1 movc A, @A+DPTR sjmp end $ ; Infinite loop (``$'' stands for address of current instruction) ; End of assembly, everything after this directive is ignored
55
sp `onditionb spx `onditionb sphip `symolb spxhip `symolb ivi ivisp `onditionb ivispx `onditionb ivisphip `symolb ivispxhip `symolb ixhsp
; Assign number 14 to symbol abc ; Assign number 10 to symbol abc Assemble only if symbol abc has been defined <--+ Assemble if 13 has been assigned to symbol abc | <--+ Assemble if 14 has been assigned to symbol abc | <--+ Assemble if the value assigned to symbol abc is even | <--+ Else .. | <--+ Assemble if symbol xyz has NOT been defined Else ... <--+ Assemble if ( yxz modulo 2 ) is 0 | <--+
56
; This is the same as if you wrote this: mov a, p0 cpl a mov p1, a mov a, p0 cpl a mov p1, a mov a, p0 cpl a mov p1, a
57
; This is the same as if you wrote this: mov a, p0 cpl a mov p1, a mov a, p0 cpl a mov p1, a
; Define macro named as ``xyz'' with 2 mandatory parameters xyz macro foo, bar mov foo, #10h cpl bar endm xyz xyz a, c p0, p1.0 ; Expand macro ``xyz'' here ; Expand macro ``xyz'' here
; This is the same as if you wrote this: ; xyz a, c mov a, #10h cpl c ; xyz p0, p1.0 mov p0, #10h cpl p1.0
58
; This is the same ; ijk 5 add A, if 5 = 4d nop endif subb A, ; ijk 4 add A, if 4 = 4d nop endif subb A,
#5 @R0
#4
59
; Suppose we have these macros: abc macro mov a, p0 cpl a mov p1, a endm ijk macro foo add A, @R0 if foo = 4d nop endif endm xyz subb macro ijk ijk abc A, #foo foo, bar foo bar
endm
; And we expand ``xyz'' like this: xyz 4, 5 ; Then we get this result: ; ijk 4 add A, @R0 nop ; <-- Note this subb A, #4 ; ijk 5 add A, @R0 subb A, #5 ; abc mov a, p0 cpl a mov p1, a
abc macro ; Unnamed macro cannot be contained inside a named one times 2 mov a, p0 cpl a mov p1, a endm endm
60
61
62
line pre(xed with line numer nd some dditionl informtion whih will e explined lterF fesides the originl ode there is lso tle of symols de(ned during the ssemly unless it ws turned o'F gode listing is divided into pges seprted y form feed hrterD this ehvior my e ltered y ertin ssemler ontrol sequenes s well s pge height nd widthF ih line of ode listing whih ontins originl soure ode line my ontin eside line numer lso some dditionl informtion regrding the ompiltion of the given line of odeF uh dditionl informtion might look like this nd is omposed of these prtsX gontrol sequenes 'eting formt of the generted ode listingF
63
X data 55h l: inc A abc ; Expand macro abc here mov a, p0 cpl a mov p1, a
=1
18 33 35 36 37 38
+1 +1 +1 +1
vine numer vevel of (le inlusion vevel of mro expnsion eddress in ode memory whine ode or nother vlue to e stored in the ode memory lue of symol yriginl line
PA
64
V hex ode
trt ode fyte ount eddress eord type ht gheksum @two9s omplement of VEit sum of entire reordD exept for the strt ode nd the heksum itselfA eord types ville in sntel R V ri
00 01
65
Chapter 5 Disassembler
hisssemler is tool intended to generte ssemly lnguge ode from n ojet (leF sn other words it hs ertin level of pility of reversing the ssemly proess nd regining the originl soure ode from ny ojet odeF fut there re some restrition to tht pility nd the whole thing is not so simple fter llF o let9s disuss disssemly proess deeperF sn wg VHSI shi you n invoke disssemler from the min menu Main Menu Tools DisassembleF
A simple example of a code generated by disassembler
Original code:
org main: inc inc cjne mov sjmp end
0h
R0 ; Increment R0 @R0 R0, #07Fh, main R0, #0d ; main ; Jump back to label main ; End of assembly
es you n see from the exmple oveD the ode generted y disssemE ler is the sme s the originl odeF fut of ourse originl symol nmes hve vnished s well s ommentsD indenttion nd other tiny detils whih nnot e determined from the ojet odeF his is used y the simple ft tht the ojet ode ontins only the mhine odeF st ontins no inforE mtion regrding how extly the originl ode looked likeF tust instrutions with their opernds nd dt diretly written to the ode memory y hf nd h diretivesF end here we re getting to the rel prolem whih emerges every time when you try to disssemle not extly simple odeF VHSI instrutions omprises of ID P or Q ytesD the (rst yte determintes wht instrution re we deling with nd so wht is its length in ytesF fut
66
CHAPTER 5. DISASSEMBLER
if the originl ode ontined diretives hf or h then the disssemler thinks tht these vlues re instrutions tooF sf the disssemler onsider ritrry vlue given y hf or h instrution to e n instrutionD it determintes its length ording to its y ode @the Ist rgument to the diE retiveAF end so it tkes HD I or P ytes next nd interprets them s opernds to tht instrutionF hen when it enounters rel instrution y ode it might think of it s nother opernd to something nd so misinterpret itF hen you might end up with ode tht is ompletely di'erent from the originl ode nd mkes no sense t ll to humnF fut if you ressemle suh non sense ode with disled peep hole optimiztion you must get the originl ojet ode kD nd its funtionlity must not e hngedF iven if the ode seems to e solutely non senseF sn tht se s strongly reommend to use nother disssemler thn is the uiltEin oneF gonsider for exmple hSP http://www.8052.com/users/disasm/F he uiltEin dissemE ler is provided just for ompletenessD ut its suitility for rel reverse engineering is highly questionleF
A simple example of a BADLY generated code by disassembler
Original code:
org main: inc inc jmp db cjne mov sjmp end
0h
cont:
R0 ; Increment R0 @R0 cont 'some stringx' R0, #07Fh, main R0, #0d ; main ; Jump back to label main ; End of assembly
67
Step
ixeute extly one intrutionD no mtter how mny mhine yles it will tkeF his does not pply for mroEinstrutionD in tht se eh instrution of the mro is exeuted seprtelyF ixeute s mny instrutions s possile until simultor ursor hnges its lotion from one line of soure ode to notherF
ho the sme s step ut in loopD one fter nother until stopped y wring ondition or user requestF his is generlly the sme s nimteD ut muh fsterD euse qs is not updted so o'ten s in the nimte modeF ke k the lst performed stepF here is limited numer of step whih n e tken kF
(Step Back)
irul r n e enled or disledD it signi(ntly 'ets speed of the simultionF yf ourse simultion is slower when virtul r is onF
68
6.4 Limitations
IF PF QF RF e simultion is limited in urrent version s simultion is not implemented imultion of redued power onsumption modes is not supported imulted wg is mny times slower the rel one would e on norml onditions
69
perature which this simulated device should measure can be set by used on the scale in DS1620 simulator window. All internal registers of the device are displayed to the user and are modiable by the user, current conguration of the device simulator including DS1620 non-volatile registers can be save into a le for further use. All communications with the simulated MCU and internal operation of the simulated thermometer are displayed in simulator log, log can be accessed via the DS1620 simulator conguration menu ( ).
Figure 6.1:
DS1620 simulator
trary GPIO line to a specied output le. This function can be particularly useful when you are dealing with a 8051 pro-
70
71
shinning last time and which were not. Column mapping is the same but for columns and random mapping means that each LED will dim af-
ter specied interval and not when its row or column is activated. So in random mapping you have to wait until all LEDs are gray before you can draw a new image without being aected by the last one.
are
Keys
can be congured to behave as radio Note that this tool can be also used to interconnect some port pins together statically, like wires in a bread board. Any key press takes
Figure 6.7: Matrix Keypad
eect immediately in all other virtual hardware components connected to the same line.
1 Radio buttons that means that one one key can be pressed at the time and when you
press another key, the originally pressed key will return back to non pressed state
72
buttons.
RAM (DDRAM), the character generator RAM (CGRAM) and certain HD44780 registers: instruction register (IR), data register (DR), address counter (AC) and display shift, these registers are shown in hexadecimal representation. User can also view content of character generator ROM (CGROM) and set font to use. All of the driver commands are fully supported and all important events occurring in the simulated driver (HD44780) are recorded in the simulator log. User can also see and modify certain HD44780 conguration ags like B, S, D and so on. And the window is collapsible.
Figure
6.11: Figure
CGRAM
DDRAM
73
HW control plug-in
74
Windows
the directory
carry the name of your plug-in, where spaces are replaced with _ (unFor example suppose you want to create a plug-in named as My First Plug-in v1.0, then your plug-in directory directory is My_First_Plug-in_v1.0. 2.
.tcl!
again our My First Plug-in v1.0 plug-in, as we mentioned before. in_v1.0 then the initialization le is: /usr/share/mcu8051ide/hwplugins/My_First_Plug-in_v1.0.tcl. 3.
/usr/share/mcu8051ide/hwplugins/My_First_Plug-
4.
75
... means any code you want there. See /usr/share/mcu8051ide/hwplugins/plugin_template.txt or <YourInstallationDirectory>\hwplugins\plug-in_template.txt for more details and for a template for such le. When you have these steps completed you have prepared basic environment for the plug-in. Then the HW plug-ins manager in the right panel in IDE's If it Any other les which your GUI should now recognize your plug-in and be able to attempt to load it. is not so, then there is denitely something wrong. in directory (1).
plug-in consist of and just whatever you want there should be placed in your plugAnd the initialization le should do nothing else than source some real plug-in's le(s) and call appropriate functions inside them. important thing, the plug-in runs it One more Take it
into account, otherwise your plug-in wont work! Function init takes the name of this namespace in parameter current_namespace. So as you can see, it's quite easy you have just to dene 4 variables and 5 functions and you can interface with the IDE.
## Check whether there is some project opened in the IDE # @return Bool - 1 == Yes, there is; 0 == No there is not proc is_project_opened {} ## Check whether MCU simulator is engaged # @return Bool - 0 == 1 == Yes, it is; No it is not (or no project is opened) proc is_simulator_engaged {} ## Get full name of file which is currently displayed in the source code editor # @return String - Full file name including path or empty string in case there is no project opened proc get_current_file {} ## Get full name of file which has been chosen as the project main file # @return String - Full file name or empty string proc get_project_main_file {} ## Get path the directory of currently active project # @return String - Directory path or empty string in case there is no project opened proc get_project_dir {} ## Get name of the current project # @return String - Name of the current project or empty string in case there is no project opened proc get_project_name {} ## Initiate compilation if at least one of the source files was modified
76
# @parm String success_callback - Any command to execute after successful compilation # @parm String failure_callback - Any command to execute after unsuccessful compilation # @return Bool - 1 == Process successfully started; 0 == Unable to comply (no project is opened) proc compile_if_nessesary_and_callback {success_callback failure_callback} ## Open the specified Intel R 8 hex file in hexadecimal editor # @parm String filename - Name of file to open (including path) # @return Bool - 1 == Success; 0 == Failure proc open_in_hexeditor {filename} ## Start MCU simulator if possible # @return Bool - 1 == Success; 0 == Unable to comply proc start_simulator {} ## Shutdown MCU simulator if possible # @return Bool - 1 == Success; 0 == Unable to comply proc shutdown_simulator {}
proc dispose {} { tk_messageBox \ -title "My First Plug-in" \ -message "Called: dispose {}" } proc init {main_frame project_object current_namespace directory} { pack [label $main_frame.l0 -text $current_namespace] -anchor w pack [label $main_frame.l1 -text $directory] -anchor w set f [labelframe $main_frame.f -text "My First Plug-in"] pack [label $f.l0 -text "is_project_opened : [::HwManager::is_project_opened]"] -anchor w
77
pack [ttk::button $f.b0 -text "update" -command " $f.l0 configure -text \"is_project_opened : \[::HwManager::is_project_opened\]\" $f.l1 configure -text \"is_simulator_engaged : \[::HwManager::is_simulator_engaged\]\" $f.l2 configure -text \"get_current_file : \[::HwManager::get_current_file\]\" $f.l3 configure -text \"get_project_main_file : \[::HwManager::get_project_main_file\]\" $f.l4 configure -text \"get_project_dir : \[::HwManager::get_project_dir\]\" $f.l5 configure -text \"get_project_name : \[::HwManager::get_project_name\]\" "] -anchor w pack $f -fill both -expand 1 pack [ttk::button $main_frame.b1 \ -text "start_simulator" \ -command {::HwManager::start_simulator} \ ] -side left pack [ttk::button $main_frame.b2 \ -text "shutdown_simulator" \ -command {::HwManager::shutdown_simulator} \ ] -side left
proc restore_session {session_data} { tk_messageBox \ -title "My First Plug-in" \ -message "Called: restore_session {$session_data}" } proc save_session {} { tk_messageBox \ -title "My First Plug-in" \ -message "Called: save_session {}" return "my data, time: [clock format [clock seconds] -format {%T}]" } proc is_busy {} { return [expr { [tk_messageBox \ -title "My First Plug-in" \ -message "Called: is_busy {}" \ -type {yesno} ] == {yes}}] }
Don't forget that your plug-in runs the main thread as well as the GUI of the entire IDE. So if your plug-in does some time expensive operations and it is probable that it does. Then these operations have to be performed in either separate thread or have to run in separate process. It is also possible to regularly update the application by reentering the event loop using Tcl's
update command.
Plug-in les must use encoding UTF-8 and should use LF (Line Feed) char-
78
Although it is possible to name the plug-in directory in any way what your OS accept. It is generally a good idea to follow the mentioned recommendation. At least the name of the initialization le have to follow the mentioned recommendation.
Plug-ins have unrestricted access to the entire application. So they should be written carefully, because plug-ins can theoretically crash down the entire IDE.
Program errors which occurs during loading or unloading of a plug-in are reported via a special dialog. email address are mentioned. In this dialog plug-in author and his or her
Before version 1.4 plug-ins must have had to be written to access directly the functionality currently hidden behind ::HwManager, so it was much more complicated.
Each instance of a hardware plug-ins manager is bond to its project. But actual plug-ins don't have to be. That's the reason why there is function All functions inside the above men::HwManager::is_project_opened .
tioned API (::HwManager::*) works with the current project, not necessaryly with the project which is the HW manager bond with.
79
Switch
General
help, -h quiet, -q nosplash nocolor, -n version, -V defaults minimalized config-file filename check-libraries ignore-last-session open-project project reset-user-settings auto-indent input hex2bin input output bin2hex input output sim2hex input output sim2bin input output normalize-hex input disassemble hex_file assemble asm_file compile asm_file iram-size size code-size size xram-size size no-opt comp-quiet no-sim no-bin no-lst
Meaning
Show help for CLI Do not who initialization progress on start-up Do not show the splash screen Do not show colorful output in console Show program version and exit Ru program in empty session Run in minimalized window Specify path to an alternative conguration le Verify whether all required libraries are available Start with an empty session Open just this project Reset all user setting to defaults
Data conversions
Reformat indentation the specied le Convert Intel 8 Hex into a binary le Convert a binary le in Intel 8 HEX Convert MCU 8051 IDE simulator le to Intel 8 Hex le Convert MCU 8051 IDE simulator le to binary le Normalize Intel 8 HEX (force incremental addressing order)
Assembler/Disassembler
Disassemble Intel 8 HEX le to hex_le.asm Assemble the specied le The same as assemble Set size of internal data memory for assembler Set size of program data memory for assembler Set size of external data memory for assembler Disable peephole optimization Suppress text output from the assembler Disable generation of .adf le Disable generation of .bin le Disable generation of .lst le
80
no-hex warning-level
Meaning
Interesting examples:
# Reset all IDE settings to defaults mcu8051ide --reset-user-settings # Use MCU 8051 IDE as assembler (without GUI) mcu8051ide --compile /some_directory/my_file.asm # Use MCU 8051 IDE as disssembler (without GUI) mcu8051ide --disassemble /some_directory/my_file.hex # Use MCU 8051 IDE as convertor from binary files to Intel 8 HEX (without GUI) mcu8051ide --bin2hex /some_directory/my_file /some_directory/my_file.hex
81
template.txt which is template of MCU 8051 IDE translation le. Along with it there is also le languages.txt which denes names of languages to which the IDE was already translated. These names are written in these languages. Translation les look like this ru.msg (Russian translation) or cs.msg (Czech translation), these les need to be regularly updated. Note also that these les are quite big, each about 0.5MB and each contains about 4500 translated sentences. Further details regarding the translation are mentioned directly in the les related to translation, particularly in le template.txt. Refer to them if you are interested in making your own translation of the IDE. This is an open-source project so any help is appreciated. The rst several lines in le template.txt:
# # # # # # # # # # # # #
This is a template of MCU 8051 IDE translation file This file allows to localize the the user environment of the IDE to almost any language. HOW TO MAKE IT WORK: 1) Copy this file (template.txt) to <lang_code>.msg in the same directory. Where ``<lang_code>'' is supposed to be replaced with language code of the translation. For example ``ru'' means Russian, or ``cs'' means Czech. The language code must be lowercase. 2) Translate all sentences enclosed by ``'' (paragraph) character. And be sure to remove the ``'' character. 3) Modify file ``languages.tcl'' and add name of language which you are
mcset $l "Replace all" \ "Replace all" ;# <-- NOT TRANSLATED YET mcset $l "Find next" \ "Find next" ;# <-- NOT TRANSLATED YET mcset $l "Close" \ "Close" ;# <-- NOT TRANSLATED YET mcset $l "Replace confirmation - %s" \ "Replace confirmation - %s" ;# <-- NOT TRANSLATED YET mcset $l "Go to line" \ "Go to line" ;# <-- NOT TRANSLATED YET mcset $l "Ok" \ "Ok" ;# <-- NOT TRANSLATED YET mcset $l "Cancel" \ "Cancel" ;# <-- NOT TRANSLATED YET mcset $l "Go to line - MCU 8051 IDE" \ "Go to line - MCU 8051 IDE" ;# <-- NOT TRANSLATED YET mcset $l "Choose directory - MCU 8051 IDE" \ "Choose directory - MCU 8051 IDE" ;# <-- NOT TRANSLATED YET
83
Appendix A License
MCU 8051 IDE and all its components is distributed under terms of GNU GPLv2.
GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundations software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each authors protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyones free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Programs source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that whole or in part contains or is part thereof, to be licensed as parties under the terms of this you distribute or publish, that in derived from the Program or any a whole at no charge to all third License.
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
84
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions
APPENDIX A. LICENSE
either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the programs name and a brief idea of what it does.> Copyright (C) 19yy <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w. This is free software, and you are welcome to redistribute it under certain conditions; type `show c for details. The hypothetical commands `show w and `show c should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w and `show c; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.
85
YET.
NOT PREPARED
to the IDE's code, these regression test should be run in order to detect possible bug introductions caused by recent changes. Regression test also serves as a proof of certain software functionality and reliability.
.in
86
testcases directory also contains les intended for comparison with les generated during the test and stored in the results directory, these les must have extension .<x>.exp. Where <x> must be substituted with extension of a le which this le is supposed to be compared to. In another words, if I want to check whether for example ./results/something.abc was generated as it should be, I have to create le ./testcases/something.abc.exp and this le will be automatically compared with ./results/something.abc. And that's it! This is simple, isn't it? It's just about comparing les. But how are the tests run and how the les in the results directory gets generated? For that we need some Bash script, which is used to run the test, let's call this script the runtest script. The runtest script must be located in the test directory and must include the rte.lib.sh le, using the source command (or '.' command). This script should have set permissions to be executable and this script species how exactly should be the test performed and also runs the test itself. When the script is about to exit, this condition is trapped and the 'rte.lib.sh' reacts by starting the test. So there is no need to explicitly run the test by invoking some function or something like that. It runs the test automatically when there is nothing else left to do.
87
http://mcu8051ide.sf.net.
Figure C.1: Ocial web page of the MCU 8051 IDE project
//mcu8051ide.git.sourceforge.net.
1. Install GIT 2. Run git
http:
clone git://mcu8051ide.git.sourceforge.net/gitroot/mcu8051ide/mcu8051ide.
It will create your own copy of the Git repository in the current directory. 3. Once you have an existing copy of the repository you can just update it each time when you want the fresh version by this command: git
4. Then you can try the downloaded IDE version without installation using the following sequence of commands (for POSIX only) (a) (b)
cd mcu8051ide/lib ./main.tcl
5. Or install it and the use it using the following sequence of commands (for POSIX only) (a) (b) (c) (d)
89
Mnemonic
code11 code16 A A data @R0 @R1 R0 R1 R2 R3 R4 R5 R6 R7 bit code11 code16 A A data @R0 @R1 R0 R1 R2 R3 R4 R5 R6 R7 bit code11
Operands
Bytes
1 2 3 1 1 2 1 1 1 1 1 1 1 1 1 1
Flags
Cycles
1 2 2 1 P 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2
NOP AJMP LJMP RR INC INC INC INC INC INC INC INC INC INC INC INC JBC ACALL LCALL RRC DEC DEC DEC DEC DEC DEC DEC DEC DEC DEC DEC DEC JB AJMP
code8
3 2 3 1 1 2 1 1 1 1 1 1 1 1 1 1 CY P P
1 1 1 1 1 1 1 1 1 1 1 1 1 2 2
code8
3 2
90
0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x2A 0x2B 0x2C 0x2D 0x2E 0x2F 0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3A 0x3B 0x3C 0x3D 0x3E 0x3F 0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4A 0x4B 0x4C 0x4D 0x4E 0x4F 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58
Mnemonic
A A A A A A A A A A A A A bit code11
Operands
#imm8 data @R0 @R1 R0 R1 R2 R3 R4 R5 R6 R7 code8
Bytes
1 1 2 2 1 1 1 1 1 1 1 1 1 1 3 2 1 1 2 2 1 1 1 1 1 1 1 1 1 1 2 2 2 3 2 2 1 1 1 1 1 1 1 1 1 1 2 2 2 3 2 2 1 1 1 CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY
Flags
AC AC AC AC AC AC AC AC AC AC AC AC OV OV OV OV OV OV OV OV OV OV OV OV
Cycles
2 1 P P P P P P P P P P P P 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 P 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 1 2 P P P P P P P P P P P P 1 1 1 1 1 1 1 1 1 1 1 1 2 2 1 2 P P P P P 1 1 1 1 1
RET
AC AC AC AC AC AC AC AC AC AC AC AC
OV OV OV OV OV OV OV OV OV OV OV OV
P P P P P P P P P P P P
91
Opcode
0x59 0x5A 0x5B 0x5C 0x5D 0x5E 0x5F 0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6A 0x6B 0x6C 0x6D 0x6E 0x6F 0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7A 0x7B 0x7C 0x7D 0x7E 0x7F 0x80 0x81 0x82 0x83 0x84 0x85 0x86 0x87 0x88 0x89 0x8A 0x8B 0x8C 0x8D 0x8E 0x8F
Mnemonic
A A A A A A A code8 code11 data data A A A A A A A A A A A A code8 code11 C
Operands
R1 R2 R3 R4 R5 R6 R7
Bytes
1 1 1 1 1 1 1 2 2
Flags
Cycles
P P P P P P P 1 1 1 1 1 1 1 2 2 1 2 P P P P P P P P P P P P 1 1 1 1 1 1 1 1 1 1 1 1 2 2
ANL ANL ANL ANL ANL ANL ANL JZ AJMP XRL XRL XRL XRL XRL XRL XRL XRL XRL XRL XRL XRL XRL XRL JNZ ACALL ORL JMP MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV SJMP AJMP ANL MOVC DIV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV
2 3 2 2 1 1 1 1 1 1 1 1 1 1 2 2
bit #imm8 #imm8 #imm8 #imm8 #imm8 #imm8 #imm8 #imm8 #imm8 #imm8 #imm8 #imm8
2 1 2 3 2 2 2 2 2 2 2 2 2 2 2 2
CY P
2 2 1 2 1 1 1 1 1 1 1 1 1 1 2 2
@A+DPTR A data @R0 @R1 R0 R1 R2 R3 R4 R5 R6 R7 code8 code11 C A AB data data data data data data data data data data data data @R0 @R1 R0 R1 R2 R3 R4 R5 R6 R7 bit @A+PC
2 1 1 3 2 2 2 2 2 2 2 2 2 2
CY P CY OV P
2 2 4 2 2 2 2 2 2 2 2 2 2 2
92
0x90 0x91 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99 0x9A 0x9B 0x9C 0x9D 0x9E 0x9F 0xA0 0xA1 0xA2 0xA3 0xA4 0xA5 0xA6 0xA7 0xA8 0xA9 0xAA 0xAB 0xAC 0xAD 0xAE 0xAF 0xB0 0xB1 0xB2 0xB3 0xB4 0xB5 0xB6 0xB7 0xB8 0xB9 0xBA 0xBB 0xBC 0xBD 0xBE 0xBF 0xC0 0xC1 0xC2 0xC3 0xC4 0xC5 0xC6
Operands
#imm16
Bytes
3 2 2 1 2 2 1 1 1 1 1 1 1 1 1 1 2 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 1 1 2 1 CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY
Flags
Cycles
2 2 2 P 2 1 1 1 1 1 1 1 1 1 1 1 1 2 2 1 2 OV P 4 2 2 2 2 2 2 2 2 2 2 2 2 1 1
MOV ACALL MOV MOVC SUBB SUBB SUBB SUBB SUBB SUBB SUBB SUBB SUBB SUBB SUBB SUBB ORL AJMP MOV INC MUL Invalid opcode MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV ANL ACALL CPL CPL CJNE CJNE CJNE CJNE CJNE CJNE CJNE CJNE CJNE CJNE CJNE CJNE PUSH AJMP CLR CLR SWAP XCH XCH
AC AC AC AC AC AC AC AC AC AC AC AC
OV OV OV OV OV OV OV OV OV OV OV OV
P P P P P P P P P P P P
CY CY CY CY CY CY CY CY CY CY CY CY
2 2 2 2 2 2 2 2 2 2 2 2 2 2 1
CY P P
1 1 1 1
93
Opcode
0xC7 0xC8 0xC9 0xCA 0xCB 0xCC 0xCD 0xCE 0xCF 0xD0 0xD1 0xD2 0xD3 0xD4 0xD5 0xD6 0xD7 0xD8 0xD9 0xDA 0xDB 0xDC 0xDD 0xDE 0xDF 0xE0 0xE1 0xE2 0xE3 0xE4 0xE5 0xE6 0xE7 0xE8 0xE9 0xEA 0xEB 0xEC 0xED 0xEE 0xEF 0xF0 0xF1 0xF2 0xF3 0xF4 0xF5 0xF6 0xF7 0xF8 0xF9 0xFA 0xFB 0xFC 0xFD
Mnemonic
A A A A A A A A A data code11 bit C A data A A R0 R1 R2 R3 R4 R5 R6 R7 A code11 A A A A A A A A A A A A A A @DPTR code11 @R0 @R1 A data @R0 @R1 R0 R1 R2 R3 R4 R5
Operands
@R1 R0 R1 R2 R3 R4 R5 R6 R7
Bytes
1 1 1 1 1 1 1 1 1 2 2 2 1 1
Flags
Cycles
P P P P P P P P P 1 1 1 1 1 1 1 1 1 2 2 1
XCH XCH XCH XCH XCH XCH XCH XCH XCH POP ACALL SETB SETB DA DJNZ XCHD XCHD DJNZ DJNZ DJNZ DJNZ DJNZ DJNZ DJNZ DJNZ MOVX AJMP MOVX MOVX CLR MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOVX ACALL MOVX MOVX CPL MOV MOV MOV MOV MOV MOV MOV MOV MOV
CY CY P P P
1 1 2 1 1 2 2 2 2 2 2 2 2 P P P P P P P P P P P P P P P 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 P 1 1 1 1 1 1 1 1 1 1
code8 @R0 @R1 code8 code8 code8 code8 code8 code8 code8 code8 @DPTR @R0 @R1 data @R0 @R1 R0 R1 R2 R3 R4 R5 R6 R7 A A A A A A A A A A A A
3 1 1 2 2 2 2 2 2 2 2 1 2 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 2 1 1 1 1 1 1 1 1
94
0xFE 0xFF
Operands
A A
Bytes
1 1
Flags
Cycles
1 1
MOV MOV
95
Mnemonic
code11 code11 code11 code11 code11 code11 code11 code11 A A A A A A A A A A A A A A A A A A A A A A A A code11 code11
Operands
Bytes
2 2 2 2 2 2 2 2
Flags
Cycles
2 2 2 2 2 2 2 2
ACALL ACALL ACALL ACALL ACALL ACALL ACALL ACALL ADD ADD ADD ADD ADD ADD ADD ADD ADD ADD ADD ADD ADDC ADDC ADDC ADDC ADDC ADDC ADDC ADDC ADDC ADDC ADDC ADDC AJMP AJMP
2 2 1 1 1 1 1 1 1 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 2 2
CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY CY
AC AC AC AC AC AC AC AC AC AC AC AC AC AC AC AC AC AC AC AC AC AC AC AC
OV OV OV OV OV OV OV OV OV OV OV OV OV OV OV OV OV OV OV OV OV OV OV OV
P P P P P P P P P P P P P P P P P P P P P P P P
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2
Mnemonic
code11 code11 code11 code11 code11 code11 data data A A A A A A A A A A A A C C A A @R0 @R1 R0 R1 R2 R3 R4 R5 R6 R7 bit C A bit C A A A data @R0 @R1 R0 R1 R2 R3 R4 R5 R6 R7 AB data
Operands
Bytes
2 2 2 2 2 2
Flags
Cycles
2 2 2 2 2 2
AJMP AJMP AJMP AJMP AJMP AJMP ANL ANL ANL ANL ANL ANL ANL ANL ANL ANL ANL ANL ANL ANL ANL ANL CJNE CJNE CJNE CJNE CJNE CJNE CJNE CJNE CJNE CJNE CJNE CJNE CLR CLR CLR CPL CPL CPL DA DEC DEC DEC DEC DEC DEC DEC DEC DEC DEC DEC DEC DIV DJNZ
A #imm8 #imm8 data @R0 @R1 R0 R1 R2 R3 R4 R5 R6 R7 bit /bit #imm8 data #imm8 #imm8 #imm8 #imm8 #imm8 #imm8 #imm8 #imm8 #imm8 #imm8 code8 code8 code8 code8 code8 code8 code8 code8 code8 code8 code8 code8
2 3 2 2 1 1 1 1 1 1 1 1 1 1 2 2 3 3 3 3 3 3 3 3 3 3 3 3 2 1 1 2 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 CY OV P CY CY P P P CY P CY CY CY CY CY CY CY CY CY CY CY CY CY CY P P P P P P P P P P P P
1 2 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2
code8
97
Opcode
0xD8 0xD9 0xDA 0xDB 0xDC 0xDD 0xDE 0xDF 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F 0xA3 0x20 0x10 0x40 0x73 0x30 0x50 0x70 0x60 0x12 0x02 0x74 0x75 0x76 0x77 0x78 0x79 0x7A 0x7B 0x7C 0x7D 0x7E 0x7F 0x85 0x86 0x87 0x88 0x89 0x8A 0x8B 0x8C 0x8D 0x8E 0x8F 0x90
Mnemonic
R0 R1 R2 R3 R4 R5 R6 R7 A data @R0 @R1 R0 R1 R2 R3 R4 R5 R6 R7 DPTR bit bit code8
Operands
code8 code8 code8 code8 code8 code8 code8 code8
Bytes
2 2 2 2 2 2 2 2 1 2 1 1 1 1 1 1 1 1 1 1 1
Flags
Cycles
2 2 2 2 2 2 2 2 P 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 P 1 2 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2
DJNZ DJNZ DJNZ DJNZ DJNZ DJNZ DJNZ DJNZ INC INC INC INC INC INC INC INC INC INC INC INC INC JB JBC JC JMP JNB JNC JNZ JZ LCALL LJMP MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV
code8 code8
3 3 2 1
@A+DPTR bit code8 code8 code8 code16 code16 A data @R0 @R1 R0 R1 R2 R3 R4 R5 R6 R7 data data data data data data data data data data data DPTR #imm8 #imm8 #imm8 #imm8 #imm8 #imm8 #imm8 #imm8 #imm8 #imm8 #imm8 #imm8 data @R0 @R1 R0 R1 R2 R3 R4 R5 R6 R7 #imm16 code8
3 2 2 2 3 3 2 3 2 2 2 2 2 2 2 2 2 2 3 2 2 2 2 2 2 2 2 2 2 3
Mnemonic
bit C @R0 @R1 R0 R1 R2 R3 R4 R5 R6 R7 A A A A A A A A A A A data @R0 @R1 R0 R1 R2 R3 R4 R5 R6 R7 A A A A A @DPTR @R0 @R1 AB data data A A A A A A A A A
Operands
C bit data data data data data data data data data data data @R0 @R1 R0 R1 R2 R3 R4 R5 R6 R7 A A A A A A A A A A A @A+PC @A+DPTR @DPTR @R0 @R1 A A A
Bytes
2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Flags
CY
Cycles
2 1 2 2 2 2 2 2 2 2 2 2 P P P P P P P P P P P 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 P P P P P 2 2 2 2 2 2 2 2
MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOVC MOVC MOVX MOVX MOVX MOVX MOVX MOVX MUL NOP ORL ORL ORL ORL ORL ORL ORL ORL ORL ORL ORL
CY
OV
4 1 1 2
2 3 2 2 1 1 1 1 1 1 1 P P P P P P P P P
1 1 1 1 1 1 1 1 1
99
Opcode
0x4D 0x4E 0x4F 0x72 0xA0 0xD0 0xC0 0x22 0x32 0x23 0x33 0x03 0x13 0xD2 0xD3 0x80 0x94 0x95 0x96 0x97 0x98 0x99 0x9A 0x9B 0x9C 0x9D 0x9E 0x9F 0xC4 0xC5 0xC6 0xC7 0xC8 0xC9 0xCA 0xCB 0xCC 0xCD 0xCE 0xCF 0xD6 0xD7 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6A 0x6B 0x6C 0x6D 0x6E
Mnemonic
A A A C C data data
Operands
R5 R6 R7 bit /bit
Bytes
1 1 1 2 2 2 2 1 1
Flags
Cycles
P P P 1 1 1 2 2 2 2 2 2 1
ORL ORL ORL ORL ORL POP PUSH RET RETI RL RLC RR RRC SETB SETB SJMP SUBB SUBB SUBB SUBB SUBB SUBB SUBB SUBB SUBB SUBB SUBB SUBB SWAP XCH XCH XCH XCH XCH XCH XCH XCH XCH XCH XCH XCHD XCHD XRL XRL XRL XRL XRL XRL XRL XRL XRL XRL XRL XRL XRL
CY CY
A A A A bit C code8 A A A A A A A A A A A A A A A A A A A A A A A A A A data data A A A A A A A A A A A data @R0 @R1 R0 R1 R2 R3 R4 R5 R6 R7 @R0 @R1 A #imm8 #imm8 data @R0 @R1 R0 R1 R2 R3 R4 R5 R6 #imm8 data @R0 @R1 R0 R1 R2 R3 R4 R5 R6 R7
1 1 1 1 2 1 2 2 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 2 3 2 2 1 1 1 1 1 1 1 1 1 P P P P P P P P P P P P P P P P P P P P P P P P CY CY CY CY CY CY CY CY CY CY CY CY AC AC AC AC AC AC AC AC AC AC AC AC OV OV OV OV OV OV OV OV OV OV OV OV P P P P P P P P P P P P CY CY P CY P
1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1
Mnemonic
A
Operands
R7
Bytes
1
Flags
Cycles
P 1
101
F.0.2 Atmel
AT89C2051 AT89C4051 AT89C51 AT89C51RC AT89C52 AT89C55WD AT89LV51 AT89LV52 AT89LV55
Flash (Reprogramable)
http://www.atmel.com/dyn/resources/prod_documents/doc0368.pdf http://www.atmel.com/dyn/resources/prod_documents/doc1001.pdf http://www.atmel.com/dyn/resources/prod_documents/doc0265.pdf http://www.atmel.com/dyn/resources/prod_documents/doc1920.pdf http://www.atmel.com/dyn/resources/prod_documents/doc0313.pdf http://www.atmel.com/dyn/resources/prod_documents/doc1921.pdf http://www.atmel.com/dyn/resources/prod_documents/doc0303.pdf http://www.atmel.com/dyn/resources/prod_documents/doc0375.pdf http://www.atmel.com/dyn/resources/prod_documents/doc0811.pdf http://www.atmel.com/dyn/resources/prod_documents/doc1919.pdf http://www.atmel.com/dyn/resources/prod_documents/doc3053.pdf http://www.atmel.com/dyn/resources/prod_documents/doc2601.pdf http://www.atmel.com/dyn/resources/prod_documents/doc3286.pdf http://www.atmel.com/dyn/resources/prod_documents/doc3390.pdf http://www.atmel.com/dyn/resources/prod_documents/doc3390.pdf http://www.atmel.com/dyn/resources/prod_documents/doc3c0c80904bc57.pdf http://www.atmel.com/dyn/resources/prod_documents/doc3c0c80904bc57.pdf http://www.atmel.com/dyn/resources/prod_documents/doc4184.pdf http://www.atmel.com/dyn/resources/prod_documents/doc4184.pdf http://www.atmel.com/dyn/resources/prod_documents/doc4184.pdf http://www.atmel.com/dyn/resources/prod_documents/doc4431.pdf
102
ROM
T83C5102 TS80C32X2 TS80C52X2 AT80C58X2 AT87C54X2 AT87C58X2 TS80C54X2 TS80C58X2 TS87C54X2 AT80C52X2 TS87C58X2
http://www.atmel.com/dyn/resources/prod_documents/doc3c0c80904bc57.pdf http://www.atmel.com/dyn/resources/prod_documents/doc4184.pdf http://www.atmel.com/dyn/resources/prod_documents/doc4184.pdf http://www.atmel.com/dyn/resources/prod_documents/doc4431.pdf http://www.atmel.com/dyn/resources/prod_documents/doc4431.pdf http://www.atmel.com/dyn/resources/prod_documents/doc4431.pdf http://www.atmel.com/dyn/resources/prod_documents/doc4431.pdf http://www.atmel.com/dyn/resources/prod_documents/doc4431.pdf http://www.atmel.com/dyn/resources/prod_documents/doc4431.pdf http://www.atmel.com/dyn/resources/prod_documents/doc4184.pdf http://www.atmel.com/dyn/resources/prod_documents/doc4431.pdf http://www.atmel.com/dyn/resources/prod_documents/doc4428.pdf http://www.atmel.com/dyn/resources/prod_documents/doc4428.pdf
ROMless
TS80C31X2 AT80C31X2
103
1.3.9 -> 1.3.10 * Bug fixes * Extended help menu * Extended global configuration dialog * Added support for multiple widget styles and GUI background colors * Added draft of handbook * Added basic support for assembler and simulator regression testing * Added regular support for i18n (internationalization) * Modified welcome dialog * Added support for external links in the GUI 1.3.8 -> 1.3.9 * Bug fixes 1.3.7 -> 1.3.8 * Bug fixes * Added feature "Global Font Size Factor" (see MCU 8051 IDE configuration dialog) * Added breakpoint validation 1.3.6 -> 1.3.7 * Bug fixes 1.3.5 -> 1.3.6
104
* Bug fixes 1.3.4 -> 1.3.5 * Bug fixes 1.3.3 -> 1.3.4 * "Modernized" GUI * Bug fixes 1.3.1 -> 1.3.3 * Bug fixes 1.3.1 -> 1.3.2 * Bug fixes
1.3 -> 1.3.1 * Dependency on TclX is now only optional * Important chage !: Native assembler now expands macro instructions before doing conditional assembly and before defining constants and variables ! Control sequence $NOMACROSFIRST can be used to change this behavior to the state of previous versions. * Added support for AS31 assembler * Added files notepad * Improved instruction help panel * Native assembler was extended to support these directives: "IFN IFDEF IFNDEF BYTE FLAG REPT TIMES" and these constrol sequences: "$NOXR $NOXREF $XR $XREF $NOSB $SB $RESTORE $RS $SA $SAVE $PHILIPS $NOPI $PI $NOTABS $NOMOD51 $NOBUILTIN $NOMO $MO $MOD51 $NOMACRO $NOMR $LI $NOLI $GENONLY $GO $NOGEN $NOGE $GEN $GE $ $EJ $NODB $NODEBUG $DB $DEBUG $CONDONLY $NOCOND $COND $TT $PW $PL $MR $MACRO $INC $WARNING $ERROR $DA $NOMACROSFIRST" * Added stack monitor * Various bug fixes 1.2 -> 1.3 * New dependency: TclX (tested with v8.4) * Added RS232/UART debugger * A few changes in assembler * Bug fixes (Thanks to Miroslav Hradlek for many useful bug reports) 1.1.1 -> 1.2 * Bug fixes * Added tab bar 1.1 -> 1.1.1 * Added "Special calculator" * Added "Base converter" * Many tiny improvements 1.0.9 -> 1.1 * Added support for new MCUs from Intel R : 8031, 8751, 8032, 8752, 80C31, 87C51, 80C52, 87C52, 80C32, 80C54, 87C54, 80C58, 87C58 * Added support for simulating virtual hardware * Improved simulator (Implemented UART (experimental support), improved support for timers, etc.) * Improved register watches * Improved editor (improved autocompletion and many other things) * Improved panel "Instruction details" * Improved 8-segment editor * Bug fixes in assembler, disassembler and simulator engine * Some other bug fixes * Added utility "Scribble notepad" * Improved graph panel
105
1.0.7 -> 1.0.9 * Added support for C language * Added map of bit addressable area 1.0.6 -> 1.0.7 * Added Stopwatch * Improved code editor * Some bug fixes 1.0.5 -> 1.0.6 * Fixed * Added * Added * Added critical bug in Assembler v1.0.5 (related to peephole code optimization) 8 segment LED display editor ASCII chart Assembly symbol table viewer
1.0 -> 1.0.5 * Added support for external assemblers ("ASEM-51" and "ASL") * Added support for external editors ("emacs", "gvim", "kwrite" and "gedit") * Added support for embedded editors ("emacs", "vim", "nano", "dav" and "le") * Added embedded terminal emulator (rxvt-unicode) * Added function "File statistics" * Improved assembler * Added syntax highlight for code listing (*.lst) * Added search bars for "Messages" and "Todo" * Removed dependency on "tcl-thread" and "tclxml" * Added dependency on "TkImg" and "tdom" * Improved hex editor * Improved simulator (especially simulation across multiple files) * Added panel "Find in files" * Modified GUI * New error handling dialog * Some bug fixes (especially critical bug in disassembler and a few bugs in assembler) * All images are now in PNG (Portable Network Graphics) (Requires TkImg) * Some more improvements 0.9.5 -> 1.0 * MANY BUG FIXES ! (including critical) * Added support for some new MCUs ( AT89S52,AT89LS51,AT89LS52,AT89S8253,AT89S2051,AT89S4051, T87C5101,T83C5101,T83C5102,TS80C32X2,TS80C52X2,TS87C52X2, AT80C32X2,AT80C52X2,AT87C52X2,AT80C54X2,AT80C58X2,AT87C54X2, AT87C58X2,TS80C54X2,TS80C58X2,TS87C54X2,TS87C58X2,TS80C31X2, AT80C31X2 ) * Added support for peephole optimization * Faster project opening * Added interrupt monitor * Added subprograms monitor * Added SFR map * Added SFR watches * Extended command line interface * Compiler now checks for valid memory addressing (new CLI options --iram-size, --eram-size, --xram-size, --code-size) * Added program hibernation capability * Added editor commands hibernate, resume, switch-mcu, set-xcode and set-xdata * Added desktop file and application icon * Some more improvements
106
0.9.1 -> 0.9.5 * Implemented support for 80C51, 8052, AT89C2051, AT89C4051, AT89C51, AT89C51RC, AT89C52, AT89C55WD, AT89LV51, AT89LV52 and AT89LV55 * Simulator can now step back * Added popup-based completion for editor * Added tool tips for bits in simulator control panel * Added simulator configuration dialog * Added auto save function * Manual page * Added support for multi-view (editor can be now splitted vertically or horizontally) * Many bug fixes (in compiler, editor, file selection dialog, syntax highlight, simulator, etc.) * Some minor improvements (graph, disassembler, etc.) * Thread extension is no longer required to run this program (but custom commands will won't work without it) 0.9.0 -> 0.9.1 * New hexadecimal editor * New file selection dialog * Added file system browser tab on left panel * Added tips on start-up * Added editor command line * Improved editor configuration dialog * A few bug fixes * Removed dependency on IWidgets and Tix * Some minor improvements 0.8.7 -> 0.9.0 * Implemented graph * Many bug fixes (GUI, compiler, memory leaks) * Editable shortcuts * Bookmarks for opened and project files * Search panels in left and right panel * Modified GUI (checkboxes, radio buttons ...) * Support for various encodings and EOLs * Added "Tools" -> "Change letter case", "Normalize HEX" and "SIM -> BIN" * Added editor functions "Lowercase", "Uppercase" and "Capitalize" * Added help windows for opened and project files and opened projects * Added pop-up menus for entry and text widgets (globally) * Fixed problem with fonts (bad sizes) * Implemented support for line wrapping (experimental) * Added new command line options (see `mcu8051ide --help') * More status tips and tool tips * Added welcome dialog * Added demonstration project * Cleaner, faster and safer compiler * Some more minor improvements 0.8.5 -> 0.8.7 * Implemented code validation * Added tab "Instruction details" (on the right panel) * Added Clean Up dialog * Added Right Panel configuration dialog * Added Toolbar configuration dialog * Added support for custom commands * Fixed some bugs (in GUI) * Fixed many memory leaks * Cleaner code 0.8.4 -> 0.8.5
107
* * * * * * Fixed many bugs in GUI Improved editor Extended calculator Redesigned editor configuration dialog Added functions "Tools -> Reformat code" and "Tools -> Sim2Hex" Extended CLI (--reset-user-settings, --config-file, --compile, --hex2bin ...)
0.8.1 -> 0.8.4 * Fixed many bugs ... (including critical) * Added compiler configuration dialog * Added calculator timers preset * Added dialog about * Added support for exporting highlighted source code to LaTeX source * Added many ToolTips * Added StatusBar tips * Added splash screen * Added support for command line options * All images are now *.XPM (X PixMap) (require Tix package) * Changed installation procedure 0.8.0 -> 0.8.1 * Fixed * Fixed * Fixed * Added some bugs in compiler (not critical) bug in to do list (saving text as SGML) bug in project management pop-up menu to to do list
108
109
List of Tables
1 3.1 3.2 3.3 3.4 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 Software requirements Available commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 19 26 27 34 41 41 49 49 49 50 51 54 58 58 58 58 58 61 92 98 Data register watches: Register address List of pseudo-variables
Radix speciers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expression operators . . . . . . . . . . . . . . . . . . . . . . . . . . Code addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Plain numbers, these symbols are always dened! . . . . . . . . . . Predened SFR bit addresses Predened SFR addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.10 Instruction mnemonics . . . . . . . . . . . . . . . . . . . . . . . . . 4.11 Directives 4.12 Expression operators . . . . . . . . . . . . . . . . . . . . . . . . . . 4.13 Assembler controls 4.14 Control sequences aecting code listing . . . . . . . . . . . . . . . . D.1 E.1 8051 Instructions in numerical Order . . . . . . . . . . . . . . . . . 8051 Instructions in lexical Order . . . . . . . . . . . . . . . . . . .
110
LIST OF TABLES
111
List of Figures
1.1 2.1 2.2 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 i8051 micro-architecture . . . . . . . . . . . . . . . . . . . . . . . . . 12 15 16 17 18 18 20 20 20 20 21 21 22 22 23 24 25 25 26 27 27 28 28 28 29 30 30 31 32 MCU 8051 IDE with the demonstration project opened within it
Project creation dialog . . . . . . . . . . . . . . . . . . . . . . . . . Syntax validation conguration button . . . . . . . . . . . . . . . . Spell checker conguration button completion all in action . . . . . . . . . . . . . . . . . .
Syntax highlight, syntax validation and the pop-up based auto. . . . . . . . . . . . . . . . . . . . . . . . Main panel of the simulator . . . . . . . . . . . . . . . . . . . . . . Highlighted SFR register . . . . . . . . . . . . . . . . . . . . . . . . Tool tip help for a special function bit . . . . . . . . . . . . . . . .
Messages panel
3.10 Personal notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.11 Calculator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.12 Embedded rxvt-unicode terminal emulator, with the Midnight Commander running in it . . . . . . . . . . . . . . . . . . . . . . . . . . 3.13 SFR watches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.17 Map of the bit addressable area . . . . . . . . . . . . . . . . . . . . 3.18 Stack monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.19 Symbol viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.20 ASCII chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.21 8051 Instruction Table . . . . . . . . . . . . . . . . . . . . . . . . . 3.22 8-segment editor 3.23 Base convertor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.24 UART/RS-232 debugger . . . . . . . . . . . . . . . . . . . . . . . . 3.25 MCU code memory editor . . . . . . . . . . . . . . . . . . . . . . . 3.26 Interrupt monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . .
112
3.28 Custom commands conguration dialog 3.30 Main toolbar
LIST OF FIGURES
34 35 35 37 37 67 67 68 68 68 69 69 70 70 70 70 70 70 71 74 83 85 . . . . . . . . . . . . . . .
3.27 Change letter case dialog . . . . . . . . . . . . . . . . . . . . . . . . 3.29 Editor conguration dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.31 Global conguration dialog 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9
DS1620 simulator and its log window . . . . . . . . . . . . . . . . . PALE I/O interface . . . . . . . . . . . . . . . . . . . . . . . . . . . LED Panel LED Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.10 HD44780 Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.11 CGRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.12 DDRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.13 View on CGROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1 7.2 B.1 C.1 An example of HW control plug-in . . . . . . . . . . . . . . . . . .