URL
https://opencores.org/ocsvn/light8080/light8080/trunk
Subversion Repositories light8080
[/] [light8080/] [trunk/] [c/] [HELLO.LST] - Rev 66
Go to most recent revision | Compare with Previous | Blame | View Log
AS80 Assembler for i8080-Z180 [1.11]. Page 1--------------------------------- HELLO.ASM ------------------------------------------------------------------ Symbol Table --------------------------------Symbol Value Decimalccand : $0064 100ccasl : $00d4 212ccasr : $00c6 198ccbcneg : $0157 343cccmp : $0091 145cccmpbcde : $0167 359cccmp1 : $009e 158cccom : $00e7 231ccdeneg : $014f 335ccdiv : $010e 270ccdiv1 : $0124 292ccdiv2 : $013b 315ccdiv3 : $0144 324cceq : $006b 107ccgchar : $0042 66ccge : $0085 133ccgint : $0048 72ccgt : $0077 119ccle : $007e 126cclt : $008b 139ccmult : $00ee 238ccmult1 : $00f3 243ccne : $0071 113ccneg : $00e2 226ccor : $0056 86ccpchar : $004d 77ccpint : $0050 80ccrdel : $015f 351ccsub : $00db 219ccsxt : $0043 67ccucmp : $00bb 187ccuge : $00a1 161ccugt : $00ad 173ccule : $00b4 180ccult : $00a7 167ccxor : $005d 93cc1 : $03d0 976cc10 : $02bb 699cc11 : $0310 784cc12 : $0322 802cc13 : $03b1 945cc14 : $03cf 975cc15 : $03cc 972cc2 : $016c 364cc3 : $0181 385cc4 : $01ae 430cc5 : $01b2 434cc6 : $01c4 452cc7 : $01f4 500cc8 : $0224 548cc9 : $0262 610__getbyte : $018c 396__int0_isr : $0324 804__main : $0330 816__nl : $01b3 435__outint : $0231 561__printdec : $01f5 501__printhex : $028a 650AS80 Assembler for i8080-Z180 [1.11]. Page 2--------------------------------- HELLO.ASM ----------------------------------__printstr : $01c4 452__rxbyte : $042c 1068__sendbyte : $016c 364__tstary : $042d 1069__8080__ : $0001 163 labels used924 lines read, no errors in pass 1.AS80 Assembler for i8080-Z180 [1.11]. Page 3--------------------------------- HELLO.ASM ----------------------------------; <><><> Small-C V1.2 DOS--CP/M Cross Compiler <; <><><><><> CP/M Large String Space Version <><><; <><><><><><><><><><> By Ron Cain <><><><><><><><;code0000 = org #00000000 : 21000c ld hl,30720003 : f9 ld sp,hl0004 : cd3003 call __main;//---------------------------------------------------;// Project: light8080 SOC WiCores Solutions;//;// File name: hello.c (February 04, 2012);//;// Writer: Moti Litochevski;//;// Description:;// This file contains a simple program written in Sm;// the UART and then switches to echo received bytes;// This example also include a simple interrupt exam;// verilog testbench. the testbench;//;// Revision History:;//;// Rev <revnumber> <Date> <owner>;// <comment>;//---------------------------------------------------;// define interrupt vectors;// note that this file must be edited to enable inter;#include intr_vec.h;//---------------------------------------------------;// Project: light8080 SOC WiCores Solutions;//;// File name: intr_vec.h (March 03, 2012);//;// Writer: Moti Litochevski;//;// Description:;// This file contains a simple example of calling in;// file defines the interrupt vector for external in;// 0x0008. the interrupts vectors addresses are set;// controller "intr_ctrl.v" file.;// Code is generated for all 4 supported external in;// are not called.;// On execution of an interrupt the CPU will automat;// enable flag set by the EI instruction. the interr;// enable the interrupts again after interrupt servi;// nested interrupts just move the EI instruction to;// call instruction to the service routine (see comm;// Note that this code is not optimized in any way.;// verify the interrupt mechanism of the light8080 C;//;// Revision History:;//;// Rev <revnumber> <Date> <owner>;// <comment>;//---------------------------------------------------;// to support interrupt enable the respective interru;// beginning of the output assembly file. only the in;// should call a valid interrupt service routine name;// C function name should be prefixed by "__".;#asmAS80 Assembler for i8080-Z180 [1.11]. Page 4--------------------------------- HELLO.ASM ----------------------------------;Preserve space for interrupt routines;interrupt 0 vector0008 = org #00080008 : f5 push af0009 : c5 push bc000a : d5 push de000b : e5 push hl; ei ; to enable nested interrupts uncomment this000c : cd2403 call __int0_isr000f : e1 pop hl0010 : d1 pop de0011 : c1 pop bc0012 : f1 pop af0013 : fb ei ; interrupt are not enabled during the execut0014 : c9 ret;interrupt 1 vector0018 = org #00180018 : f5 push af0019 : c5 push bc001a : d5 push de001b : e5 push hl; call __int1_isr ; interrupt not used001c : e1 pop hl001d : d1 pop de001e : c1 pop bc001f : f1 pop af0020 : fb ei0021 : c9 ret;interrupt 2 vector0028 = org #00280028 : f5 push af0029 : c5 push bc002a : d5 push de002b : e5 push hl; call __int2_isr ; interrupt not used002c : e1 pop hl002d : d1 pop de002e : c1 pop bc002f : f1 pop af0030 : fb ei0031 : c9 ret;interrupt 3 vector0038 = org #00380038 : f5 push af0039 : c5 push bc003a : d5 push de003b : e5 push hl; call __int3_isr ; interrupt not used003c : e1 pop hl003d : d1 pop de003e : c1 pop bc003f : f1 pop af0040 : fb ei0041 : c9 ret;//---------------------------------------------------;// Th.. Th.. Th.. Thats all folks !!!;//---------------------------------------------------;// insert c80 assmbly library to the output file;#include ..\tools\c80\c80.lib;#asm;;-----------------------------------------------------AS80 Assembler for i8080-Z180 [1.11]. Page 5--------------------------------- HELLO.ASM ----------------------------------; Small-C Run-time Librray;; V4d As of July 16, 1980 (gtf); Added EXIT() function;-----------------------------------------------------;;Fetch a single byte from the address in HL and sign e0042 : ccgchar:0042 : 7e ld a,(hl)0043 : ccsxt:0043 : 6f ld l,a0044 : 07 rlca0045 : 9f sbc a0046 : 67 ld h,a0047 : c9 ret;Fetch a full 16-bit integer from the address in HL0048 : ccgint:0048 : 7e ld a,(hl)0049 : 23 inc hl004a : 66 ld h,(hl)004b : 6f ld l,a004c : c9 ret;Store a single byte from HL at the address in DE004d : ccpchar:004d : 7d ld a,l004e : 12 ld (de),a004f : c9 ret;Store a 16-bit integer in HL at the address in DE0050 : ccpint:0050 : 7d ld a,l0051 : 12 ld (de),a0052 : 13 inc de0053 : 7c ld a,h0054 : 12 ld (de),a0055 : c9 ret;Inclusive "or" HL and DE into HL0056 : ccor:0056 : 7d ld a,l0057 : b3 or e0058 : 6f ld l,a0059 : 7c ld a,h005a : b2 or d005b : 67 ld h,a005c : c9 ret;Exclusive "or" HL and DE into HL005d : ccxor:005d : 7d ld a,l005e : ab xor e005f : 6f ld l,a0060 : 7c ld a,h0061 : aa xor d0062 : 67 ld h,a0063 : c9 ret;"And" HL and DE into HL0064 : ccand:0064 : 7d ld a,l0065 : a3 and e0066 : 6f ld l,a0067 : 7c ld a,h0068 : a2 and d0069 : 67 ld h,a006a : c9 retAS80 Assembler for i8080-Z180 [1.11]. Page 6--------------------------------- HELLO.ASM ----------------------------------;Test if HL = DE and set HL = 1 if true else 0006b : cceq:006b : cd9100 call cccmp006e : c8 ret z006f : 2b dec hl0070 : c9 ret;Test if DE ~= HL0071 : ccne:0071 : cd9100 call cccmp0074 : c0 ret nz0075 : 2b dec hl0076 : c9 ret;Test if DE > HL (signed)0077 : ccgt:0077 : eb ex de,hl0078 : cd9100 call cccmp007b : d8 ret c007c : 2b dec hl007d : c9 ret;Test if DE <= HL (signed)007e : ccle:007e : cd9100 call cccmp0081 : c8 ret z0082 : d8 ret c0083 : 2b dec hl0084 : c9 ret;Test if DE >= HL (signed)0085 : ccge:0085 : cd9100 call cccmp0088 : d0 ret nc0089 : 2b dec hl008a : c9 ret;Test if DE < HL (signed)008b : cclt:008b : cd9100 call cccmp008e : d8 ret c008f : 2b dec hl0090 : c9 ret; Signed compare of DE and HL; Performs DE - HL and sets the conditions:; Carry reflects sign of difference (set means DE < HL; Zero/non-zero set according to equality.0091 : cccmp:0091 : 7b ld a,e0092 : 95 sub l0093 : 5f ld e,a0094 : 7a ld a,d0095 : 9c sbc h0096 : 210100 ld hl,10099 : fa9e00 jp m,cccmp1009c : b3 or e ;"OR" resets carry009d : c9 ret009e : cccmp1:009e : b3 or e009f : 37 scf ;set carry to signal minus00a0 : c9 ret;Test if DE >= HL (unsigned)00a1 : ccuge:00a1 : cdbb00 call ccucmp00a4 : d0 ret nc00a5 : 2b dec hl00a6 : c9 retAS80 Assembler for i8080-Z180 [1.11]. Page 7--------------------------------- HELLO.ASM ----------------------------------;Test if DE < HL (unsigned)00a7 : ccult:00a7 : cdbb00 call ccucmp00aa : d8 ret c00ab : 2b dec hl00ac : c9 ret;Test if DE > HL (unsigned)00ad : ccugt:00ad : eb ex de,hl00ae : cdbb00 call ccucmp00b1 : d8 ret c00b2 : 2b dec hl00b3 : c9 ret;Test if DE <= HL (unsigned)00b4 : ccule:00b4 : cdbb00 call ccucmp00b7 : c8 ret z00b8 : d8 ret c00b9 : 2b dec hl00ba : c9 ret;Routine to perform unsigned compare;carry set if DE < HL;zero/nonzero set accordingly00bb : ccucmp:00bb : 7a ld a,d00bc : bc cp h00bd : c2c200 jp nz,$+500c0 : 7b ld a,e00c1 : bd cp l00c2 : 210100 ld hl,100c5 : c9 ret;Shift DE arithmetically right by HL and return in HL00c6 : ccasr:00c6 : eb ex de,hl00c7 : 7c ld a,h00c8 : 17 rla00c9 : 7c ld a,h00ca : 1f rra00cb : 67 ld h,a00cc : 7d ld a,l00cd : 1f rra00ce : 6f ld l,a00cf : 1d dec e00d0 : c2c700 jp nz,ccasr+100d3 : c9 ret;Shift DE arithmetically left by HL and return in HL00d4 : ccasl:00d4 : eb ex de,hl00d5 : 29 add hl,hl00d6 : 1d dec e00d7 : c2d500 jp nz,ccasl+100da : c9 ret;Subtract HL from DE and return in HL00db : ccsub:00db : 7b ld a,e00dc : 95 sub l00dd : 6f ld l,a00de : 7a ld a,d00df : 9c sbc h00e0 : 67 ld h,a00e1 : c9 ret;Form the two's complement of HLAS80 Assembler for i8080-Z180 [1.11]. Page 8--------------------------------- HELLO.ASM ----------------------------------00e2 : ccneg:00e2 : cde700 call cccom00e5 : 23 inc hl00e6 : c9 ret;Form the one's complement of HL00e7 : cccom:00e7 : 7c ld a,h00e8 : 2f cpl00e9 : 67 ld h,a00ea : 7d ld a,l00eb : 2f cpl00ec : 6f ld l,a00ed : c9 ret;Multiply DE by HL and return in HL00ee : ccmult:00ee : 44 ld b,h00ef : 4d ld c,l00f0 : 210000 ld hl,000f3 : ccmult1:00f3 : 79 ld a,c00f4 : 0f rrca00f5 : d2f900 jp nc,$+400f8 : 19 add hl,de00f9 : af xor a00fa : 78 ld a,b00fb : 1f rra00fc : 47 ld b,a00fd : 79 ld a,c00fe : 1f rra00ff : 4f ld c,a0100 : b0 or b0101 : c8 ret z0102 : af xor a0103 : 7b ld a,e0104 : 17 rla0105 : 5f ld e,a0106 : 7a ld a,d0107 : 17 rla0108 : 57 ld d,a0109 : b3 or e010a : c8 ret z010b : c3f300 jp ccmult1;Divide DE by HL and return quotient in HL, remainder010e : ccdiv:010e : 44 ld b,h010f : 4d ld c,l0110 : 7a ld a,d0111 : a8 xor b0112 : f5 push af0113 : 7a ld a,d0114 : b7 or a0115 : fc4f01 call m,ccdeneg0118 : 78 ld a,b0119 : b7 or a011a : fc5701 call m,ccbcneg011d : 3e10 ld a,16011f : f5 push af0120 : eb ex de,hl0121 : 110000 ld de,00124 : ccdiv1:0124 : 29 add hl,hl0125 : cd5f01 call ccrdelAS80 Assembler for i8080-Z180 [1.11]. Page 9--------------------------------- HELLO.ASM ----------------------------------0128 : ca3b01 jp z,ccdiv2012b : cd6701 call cccmpbcde012e : fa3b01 jp m,ccdiv20131 : 7d ld a,l0132 : f601 or 10134 : 6f ld l,a0135 : 7b ld a,e0136 : 91 sub c0137 : 5f ld e,a0138 : 7a ld a,d0139 : 98 sbc b013a : 57 ld d,a013b : ccdiv2:013b : f1 pop af013c : 3d dec a013d : ca4401 jp z,ccdiv30140 : f5 push af0141 : c32401 jp ccdiv10144 : ccdiv3:0144 : f1 pop af0145 : f0 ret p0146 : cd4f01 call ccdeneg0149 : eb ex de,hl014a : cd4f01 call ccdeneg014d : eb ex de,hl014e : c9 ret014f : ccdeneg:014f : 7a ld a,d0150 : 2f cpl0151 : 57 ld d,a0152 : 7b ld a,e0153 : 2f cpl0154 : 5f ld e,a0155 : 13 inc de0156 : c9 ret0157 : ccbcneg:0157 : 78 ld a,b0158 : 2f cpl0159 : 47 ld b,a015a : 79 ld a,c015b : 2f cpl015c : 4f ld c,a015d : 03 inc bc015e : c9 ret015f : ccrdel:015f : 7b ld a,e0160 : 17 rla0161 : 5f ld e,a0162 : 7a ld a,d0163 : 17 rla0164 : 57 ld d,a0165 : b3 or e0166 : c9 ret0167 : cccmpbcde:0167 : 7b ld a,e0168 : 91 sub c0169 : 7a ld a,d016a : 98 sbc b016b : c9 ret;// UART IO registers;port (128) UDATA; // uart data register used for bot;port (129) UBAUDL; // low byte of baud rate registerAS80 Assembler for i8080-Z180 [1.11]. Page 10--------------------------------- HELLO.ASM ----------------------------------;port (130) UBAUDH; // low byte of baud rate register;port (131) USTAT; // uart status register;// digital IO ports registers;port (132) P1DATA; // port 1 data register;port (133) P1DIR; // port 1 direction register contr;port (134) P2DATA; // port 2 data register;port (135) P2DIR; // port 2 direction register contr;// interrupt controller register;port (136) INTRENA; // interrupts enable register;// simulation end register;// writing any value to this port will end the verilo;// test bench.;port (255) SIMEND;;// registers bit fields definition;// uart status register decoding;#define UTXBUSY 1;#define URXFULL 16;// globals;char rxbyte; // byte received from the uart;int tstary[2] = {1234, 5678};;//---------------------------------------------------;// send a single byte to the UART;sendbyte(by)016c : __sendbyte:;char by;;{; while (USTAT & UTXBUSY);016c : cc2:016c : db83 in a,(131)016e : cd4300 call ccsxt0171 : e5 push hl0172 : 210100 ld hl,10175 : d1 pop de0176 : cd6400 call ccand0179 : 7c ld a,h017a : b5 or l017b : ca8101 jp z,cc3017e : c36c01 jp cc20181 : cc3:; UDATA = by;0181 : 210200 ld hl,20184 : 39 add hl,sp0185 : cd4200 call ccgchar0188 : 7d ld a,l0189 : d380 out (128),a;}018b : c9 ret;// check if a byte was received by the uart;getbyte()018c : __getbyte:;{; if (USTAT & URXFULL) {018c : db83 in a,(131)018e : cd4300 call ccsxt0191 : e5 push hl0192 : 211000 ld hl,160195 : d1 pop de0196 : cd6400 call ccand0199 : 7c ld a,h019a : b5 or l019b : caae01 jp z,cc4AS80 Assembler for i8080-Z180 [1.11]. Page 11--------------------------------- HELLO.ASM ----------------------------------; rxbyte = UDATA;019e : db80 in a,(128)01a0 : cd4300 call ccsxt01a3 : 7d ld a,l01a4 : 322c04 ld (__rxbyte),a; return 1;01a7 : 210100 ld hl,101aa : c9 ret; }; else01ab : c3b201 jp cc501ae : cc4:; return 0;01ae : 210000 ld hl,001b1 : c9 ret01b2 : cc5:;}01b2 : c9 ret;// send new line to the UART;nl()01b3 : __nl:;{; sendbyte(13);01b3 : 210d00 ld hl,1301b6 : e5 push hl01b7 : cd6c01 call __sendbyte01ba : c1 pop bc; sendbyte(10);01bb : 210a00 ld hl,1001be : e5 push hl01bf : cd6c01 call __sendbyte01c2 : c1 pop bc;}01c3 : c9 ret;// sends a string to the UART;printstr(sptr)01c4 : __printstr:;char *sptr;;{; while (*sptr != 0)01c4 : cc6:01c4 : 210200 ld hl,201c7 : 39 add hl,sp01c8 : cd4800 call ccgint01cb : cd4200 call ccgchar01ce : e5 push hl01cf : 210000 ld hl,001d2 : d1 pop de01d3 : cd7100 call ccne01d6 : 7c ld a,h01d7 : b5 or l01d8 : caf401 jp z,cc7; sendbyte(*sptr++);01db : 210200 ld hl,201de : 39 add hl,sp01df : e5 push hl01e0 : cd4800 call ccgint01e3 : 23 inc hl01e4 : d1 pop de01e5 : cd5000 call ccpint01e8 : 2b dec hl01e9 : cd4200 call ccgcharAS80 Assembler for i8080-Z180 [1.11]. Page 12--------------------------------- HELLO.ASM ----------------------------------01ec : e5 push hl01ed : cd6c01 call __sendbyte01f0 : c1 pop bc01f1 : c3c401 jp cc601f4 : cc7:;}01f4 : c9 ret;// sends a decimal value to the UART;printdec(dval)01f5 : __printdec:;int dval;;{; if (dval<0) {01f5 : 210200 ld hl,201f8 : 39 add hl,sp01f9 : cd4800 call ccgint01fc : e5 push hl01fd : 210000 ld hl,00200 : d1 pop de0201 : cd8b00 call cclt0204 : 7c ld a,h0205 : b5 or l0206 : ca2402 jp z,cc8; sendbyte('-');0209 : 212d00 ld hl,45020c : e5 push hl020d : cd6c01 call __sendbyte0210 : c1 pop bc; dval = -dval;0211 : 210200 ld hl,20214 : 39 add hl,sp0215 : e5 push hl0216 : 210400 ld hl,40219 : 39 add hl,sp021a : cd4800 call ccgint021d : cde200 call ccneg0220 : d1 pop de0221 : cd5000 call ccpint; }; outint(dval);0224 : cc8:0224 : 210200 ld hl,20227 : 39 add hl,sp0228 : cd4800 call ccgint022b : e5 push hl022c : cd3102 call __outint022f : c1 pop bc;}0230 : c9 ret;// function copied from c80dos.c;outint(n)0231 : __outint:;int n;;{;int q;0231 : c5 push bc; q = n/10;0232 : 210000 ld hl,00235 : 39 add hl,sp0236 : e5 push hl0237 : 210600 ld hl,6023a : 39 add hl,spAS80 Assembler for i8080-Z180 [1.11]. Page 13--------------------------------- HELLO.ASM ----------------------------------023b : cd4800 call ccgint023e : e5 push hl023f : 210a00 ld hl,100242 : d1 pop de0243 : cd0e01 call ccdiv0246 : d1 pop de0247 : cd5000 call ccpint; if (q) outint(q);024a : 210000 ld hl,0024d : 39 add hl,sp024e : cd4800 call ccgint0251 : 7c ld a,h0252 : b5 or l0253 : ca6202 jp z,cc90256 : 210000 ld hl,00259 : 39 add hl,sp025a : cd4800 call ccgint025d : e5 push hl025e : cd3102 call __outint0261 : c1 pop bc; sendbyte('0'+(n-q*10));0262 : cc9:0262 : 213000 ld hl,480265 : e5 push hl0266 : 210600 ld hl,60269 : 39 add hl,sp026a : cd4800 call ccgint026d : e5 push hl026e : 210400 ld hl,40271 : 39 add hl,sp0272 : cd4800 call ccgint0275 : e5 push hl0276 : 210a00 ld hl,100279 : d1 pop de027a : cdee00 call ccmult027d : d1 pop de027e : cddb00 call ccsub0281 : d1 pop de0282 : 19 add hl,de0283 : e5 push hl0284 : cd6c01 call __sendbyte0287 : c1 pop bc;}0288 : c1 pop bc0289 : c9 ret;// sends a hexadecimal value to the UART;printhex(hval)028a : __printhex:;int hval;;{;int q;028a : c5 push bc; q = hval/16;028b : 210000 ld hl,0028e : 39 add hl,sp028f : e5 push hl0290 : 210600 ld hl,60293 : 39 add hl,sp0294 : cd4800 call ccgint0297 : e5 push hl0298 : 211000 ld hl,16029b : d1 pop deAS80 Assembler for i8080-Z180 [1.11]. Page 14--------------------------------- HELLO.ASM ----------------------------------029c : cd0e01 call ccdiv029f : d1 pop de02a0 : cd5000 call ccpint; if (q) printhex(q);02a3 : 210000 ld hl,002a6 : 39 add hl,sp02a7 : cd4800 call ccgint02aa : 7c ld a,h02ab : b5 or l02ac : cabb02 jp z,cc1002af : 210000 ld hl,002b2 : 39 add hl,sp02b3 : cd4800 call ccgint02b6 : e5 push hl02b7 : cd8a02 call __printhex02ba : c1 pop bc; q = hval-q*16;02bb : cc10:02bb : 210000 ld hl,002be : 39 add hl,sp02bf : e5 push hl02c0 : 210600 ld hl,602c3 : 39 add hl,sp02c4 : cd4800 call ccgint02c7 : e5 push hl02c8 : 210400 ld hl,402cb : 39 add hl,sp02cc : cd4800 call ccgint02cf : e5 push hl02d0 : 211000 ld hl,1602d3 : d1 pop de02d4 : cdee00 call ccmult02d7 : d1 pop de02d8 : cddb00 call ccsub02db : d1 pop de02dc : cd5000 call ccpint; if (q > 9)02df : 210000 ld hl,002e2 : 39 add hl,sp02e3 : cd4800 call ccgint02e6 : e5 push hl02e7 : 210900 ld hl,902ea : d1 pop de02eb : cd7700 call ccgt02ee : 7c ld a,h02ef : b5 or l02f0 : ca1003 jp z,cc11; sendbyte('A'+q-10);02f3 : 214100 ld hl,6502f6 : e5 push hl02f7 : 210200 ld hl,202fa : 39 add hl,sp02fb : cd4800 call ccgint02fe : d1 pop de02ff : 19 add hl,de0300 : e5 push hl0301 : 210a00 ld hl,100304 : d1 pop de0305 : cddb00 call ccsub0308 : e5 push hl0309 : cd6c01 call __sendbyte030c : c1 pop bcAS80 Assembler for i8080-Z180 [1.11]. Page 15--------------------------------- HELLO.ASM ----------------------------------; else030d : c32203 jp cc120310 : cc11:; sendbyte('0'+q);0310 : 213000 ld hl,480313 : e5 push hl0314 : 210200 ld hl,20317 : 39 add hl,sp0318 : cd4800 call ccgint031b : d1 pop de031c : 19 add hl,de031d : e5 push hl031e : cd6c01 call __sendbyte0321 : c1 pop bc0322 : cc12:;}0322 : c1 pop bc0323 : c9 ret;// external interrupt 0 service routine;int0_isr()0324 : __int0_isr:;{; printstr("Interrupt 0 was asserted."); nl();0324 : 21d003 ld hl,cc1+00327 : e5 push hl0328 : cdc401 call __printstr032b : c1 pop bc032c : cdb301 call __nl;}032f : c9 ret;// program main routine;main()0330 : __main:;{; // configure UART baud rate - set to 9600 for 30MHz; // BAUD = round(<clock>/<baud rate>/16) = round(30e6;//MOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOT;//MOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOT;// UBAUDL = 195;; UBAUDL = 1;0330 : 210100 ld hl,10333 : 7d ld a,l0334 : d381 out (129),a;//MOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOT;//MOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOT; UBAUDH = 0;0336 : 210000 ld hl,00339 : 7d ld a,l033a : d382 out (130),a; // configure both ports to output and digital output; P1DATA = 0x00;033c : 210000 ld hl,0033f : 7d ld a,l0340 : d384 out (132),a; P1DIR = 0xff;0342 : 21ff00 ld hl,2550345 : 7d ld a,l0346 : d385 out (133),aAS80 Assembler for i8080-Z180 [1.11]. Page 16--------------------------------- HELLO.ASM ----------------------------------; P2DATA = 0x00;0348 : 210000 ld hl,0034b : 7d ld a,l034c : d386 out (134),a; P2DIR = 0xff;034e : 21ff00 ld hl,2550351 : 7d ld a,l0352 : d387 out (135),a; // enable interrupt 0 only; INTRENA = 0x01;0354 : 210100 ld hl,10357 : 7d ld a,l0358 : d388 out (136),a; // enable CPU interrupt;#asm035a : fb ei;; // print message; printstr("Hello World!!!"); nl();035b : 21ea03 ld hl,cc1+26035e : e5 push hl035f : cdc401 call __printstr0362 : c1 pop bc0363 : cdb301 call __nl; printstr("Dec value: "); printdec(tstary[1]); nl();0366 : 21f903 ld hl,cc1+410369 : e5 push hl036a : cdc401 call __printstr036d : c1 pop bc036e : 212d04 ld hl,__tstary0371 : e5 push hl0372 : 210100 ld hl,10375 : 29 add hl,hl0376 : d1 pop de0377 : 19 add hl,de0378 : cd4800 call ccgint037b : e5 push hl037c : cdf501 call __printdec037f : c1 pop bc0380 : cdb301 call __nl; printstr("Hex value: 0x"); printhex(tstary[0]); nl()0383 : 210504 ld hl,cc1+530386 : e5 push hl0387 : cdc401 call __printstr038a : c1 pop bc038b : 212d04 ld hl,__tstary038e : e5 push hl038f : 210000 ld hl,00392 : 29 add hl,hl0393 : d1 pop de0394 : 19 add hl,de0395 : cd4800 call ccgint0398 : e5 push hl0399 : cd8a02 call __printhex039c : c1 pop bc039d : cdb301 call __nl; // assert bit 0 of port 1 to test external interrupt; P1DATA = 0x01;03a0 : 210100 ld hl,1AS80 Assembler for i8080-Z180 [1.11]. Page 17--------------------------------- HELLO.ASM ----------------------------------03a3 : 7d ld a,l03a4 : d384 out (132),a;; printstr("Echoing received bytes: "); nl();03a6 : 211304 ld hl,cc1+6703a9 : e5 push hl03aa : cdc401 call __printstr03ad : c1 pop bc03ae : cdb301 call __nl; // loop forever; while (1) {03b1 : cc13:03b1 : 210100 ld hl,103b4 : 7c ld a,h03b5 : b5 or l03b6 : cacf03 jp z,cc14; // check if a new byte was received; if (getbyte())03b9 : cd8c01 call __getbyte03bc : 7c ld a,h03bd : b5 or l03be : cacc03 jp z,cc15; // echo the received byte to the UART; sendbyte(rxbyte);03c1 : 3a2c04 ld a,(__rxbyte)03c4 : cd4300 call ccsxt03c7 : e5 push hl03c8 : cd6c01 call __sendbyte03cb : c1 pop bc; }03cc : cc15:03cc : c3b103 jp cc1303cf : cc14:;}03cf : c9 ret;//---------------------------------------------------;// Th.. Th.. Th.. Thats all folks !!!;//---------------------------------------------------03d0 : cc1:03d0 : 496e7465727275.. db 73,110,116,101,114,114,117,112,116,3203da : 30207761732061.. db 48,32,119,97,115,32,97,115,115,10103e4 : 727465642e0048.. db 114,116,101,100,46,0,72,101,108,10803ee : 6f20576f726c64.. db 111,32,87,111,114,108,100,33,33,3303f8 : 00446563207661.. db 0,68,101,99,32,118,97,108,117,1010402 : 3a200048657820.. db 58,32,0,72,101,120,32,118,97,108040c : 75653a20307800.. db 117,101,58,32,48,120,0,69,99,1040416 : 6f696e67207265.. db 111,105,110,103,32,114,101,99,101,1050420 : 76656420627974.. db 118,101,100,32,98,121,116,101,115,58042a : 2000 db 32,0042c : __rxbyte:042c : 00 ds 1042d : __tstary:042d : d2042e16 db -46,4,46,22; --- End of Compilation ---No errors in pass 2.
Go to most recent revision | Compare with Previous | Blame | View Log
