Motorola M68000 Assembler Page 1 1 *************************************************** 1+ **************************) 2 * 2+ *) 3 * 3+ *) 4 * Program : M68000 Monitor for the POSIE Dist. 4+ Sys. Monitor Board *) 5 * 5+ *) 6 * Purpose : 6+ *) 7 * 7+ *) 8 * 8+ *) 9 * 9+ *) 10 * Name : Vinod E.F. REBELLO 10+ *) 11 * 11+ *) 12 * Class : CS & E 4 12+ *) 13 * 13+ *) 14 * Username : VEFR 14+ *) 15 * 15+ *) 16 * Date : 1st April 1989 Version 1.0 16+ *) 17 * 10 Oct 1990 Attempted port to I 17+ nterpretation Processor *) 18 * Note subr03.asm has 18+ changed and prompt(Msgs)*) 19 * 19+ *) 20 * Tutor : Damal K. ARVIND 20+ *) 21 * 21+ *) 22 *************************************************** 22+ **************************) 23 24 25 * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 25+ *:*:*:*:*:*:* 26 * 27 * First we have subroutine file 28 * 29 incl subr03.asm 1& * 2& * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 2+ *:*:*:*:*:*:* 3& * 4& * 68000 Monitor, Version 2.0, April 1989 5& * based on standard 8088 monitor Version 2.2; 6& * Login via main RS232 port; Motorola M68000 Assembler Page 2 7& * Link/load to network or auxiliary RS232 port; 8& * 9& * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 9+ *:*:*:*:*:*:* 10& * 11& * 12& 00000040 ICPAK equ $40 * Incoming packet bit 13& 00000002 NBUSY equ $02 * NOT Busy bit 14& 000000FD BUSY equ $0fd * Busy bit 15& 00000001 NTXREQ equ $01 * NOT Transmit Request bit 16& 000000FE TXREQ equ $0fe * Transmit Request bit 17& 00000080 PAKSNT equ $80 * Packet sent bit 18& 00000006 ICPAKN equ 6 * Bit no of incoming packet 19& 00000007 PKSNTN equ 7 * bit no of packet sent 20& * 21& 000000FF CHARPK equ $0ff * Control field for character pack 21+ et 22& 000000F6 ACKPK equ $0f6 * Control field for acknowledgem 22+ ent packet 23& 000000F4 ECHOPK equ $0f4 * Control field for echoing acknow 23+ ledgement packet 24& 000000EF CHSUPK equ $0ef * Control field for connect reques 24+ t packet 25& * 26& 00000001 CONNCT equ $01 * CONNECT 27& 00000002 ACCEPT equ $02 * ACCEPT Pattern 28& 00000010 DISCON equ $10 * DISCONNECT 29& * 30& 00000200 TOcnt equ $200 * Tx Timeout value 31& 00001000 ACKcnt equ $1000 * Acknowledgement timeout value 32& 00001000 ACCcnt equ $1000 * Accept timeout value 33& * 34& * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 34+ *:*:*:*:*:*:* 35& * 36& * Store Locations 37& * 38& * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 38+ *:*:*:*:*:*:* 39& * 40& 00011000 org $011000 41& * 42& 011000 00000002 remadd: ds.w 1 43& 011002 00000002 newadd: ds.w 1 44& 011004 00000002 remflg: ds.w 1 45& * 46& 011006 00000002 ipksa: ds.w 1 * Incoming packet, Source Address 47& 011008 00000002 ipkda: ds.w 1 * Destination address 48& 01100A 00000002 ipkd3: ds.w 1 * (msw) data 49& 01100C 00000002 ipkd1: ds.w 1 * (lsw) data 50& 01100E 00000002 ipkct: ds.w 1 * control field 51& * 52& 011010 00000002 opksa: ds.w 1 * Outgoing packet, Source Address 53& 011012 00000002 opkda: ds.w 1 * Destination Address 54& 011014 00000002 opkd3: ds.w 1 * (msw) data 55& 011016 00000002 opkd1: ds.w 1 * (lsw) data 56& 011018 00000002 opkct: ds.w 1 * control field 57& * 58& 01101A 00000002 cntflg: ds.w 1 * copy of current pacnt O/P field Motorola M68000 Assembler Page 3 59& 01101C 00000002 pakflg: ds.w 1 * packet available flag 60& 01101E 00000002 trccnt: ds.w 1 * no of instructions to trace 61& 011020 00000002 brkflg: ds.w 1 * breakpoint set flag 62& 011022 00000002 brksav: ds.w 1 * instruction word from brkpt addr 63& 011024 00000004 brkadd: ds.l 1 * breakpoint address 64& 011028 00000002 lnkflg: ds.w 1 * indicates whether link is to netwo 64+ rk or RS232 65& * 66& * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 66+ *:*:*:*:*:*:* 67& * 68& * 68000 Monitor, Version 2, March 1989 69& * 70& * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 70+ *:*:*:*:*:*:* 71& * 72& 00010000 romsize equ $010000 73& 00000000 rombot equ $000000 74& 0000FFFF romtop equ $00FFFF 75& 76& 00010000 ramsize equ $010000 * was 020000 77& 00010000 rambot equ $010000 78& 0001FFFF ramtop equ $01FFFF * was 03ffff 79& 80& * FIFO register addresses 81& 00060000 fifo equ $060000 82& 83& * filter addresses 84& *dlbar equ $050001 85& *dgbar equ $050000 86& *slbar equ $050003 87& *sgbar equ $050002 88& *contr equ $050005 89& 90& 91& * DUART register addresses 92& 00020001 base equ $020001 * was 040001 93& 00020001 modea equ base+0 94& 00020003 stata equ base+2 95& 00020003 clka equ base+2 96& 00020005 cmda equ base+4 97& 00020007 thra equ base+6 98& 00020007 rhra equ base+6 99& 00020009 ipcr equ base+8 100& 00020009 acr equ base+8 101& 0002000B isr equ base+10 102& 0002000B imr equ base+10 103& 0002000D countl equ base+12 104& 0002000F counth equ base+14 105& 00020011 modeb equ base+16 106& 00020013 statb equ base+18 107& 00020013 clkb equ base+18 108& 00020015 cmdb equ base+20 109& 00020017 rhrb equ base+22 110& 00020017 thrb equ base+22 111& 00020019 ivr equ base+24 112& 0002001B iport equ base+26 113& 0002001B opcr equ base+26 114& 0002001D stcnt equ base+28 Motorola M68000 Assembler Page 4 115& 0002001F spcnt equ base+30 116& 0002001D bitset equ base+28 117& 0002001F bitres equ base+30 118& 119& 120& 121& * mode reg 1 122& 123& 00000080 rxrts equ $80 124& 00000000 norrts equ $0 125& 126& 00000000 rirdy equ $0 127& 00000040 rifful equ $40 128& 129& 00000000 cerr equ $0 130& 00000020 blerr equ $20 131& 132& 00000000 wthpar equ $0 133& 00000008 forcep equ $8 134& 00000010 nopar equ $10 135& 00000018 multi equ $18 136& 137& 00000000 evenp equ $0 138& 00000004 oddp equ $4 139& 140& 00000000 bits5 equ $0 141& 00000001 bits6 equ $1 142& 00000002 bits7 equ $2 143& 00000003 bits8 equ $3 144& 145& * mode reg 2 146& 147& 00000000 norop equ $0 148& 00000040 echo equ $40 149& 00000080 lloop equ $80 150& 000000C0 rloop equ $C0 151& 152& 00000020 txrts equ $20 153& 00000000 notrts equ $0 154& 155& 00000010 cts equ $10 156& 00000000 nocts equ $0 157& 158& 00000007 stop1 equ $7 159& 0000000F stop2 equ $f 160& 161& * clk sel reg 162& 163& 000000BB b9600 equ $bb 164& 165& * Command REG 166& * Miscell 167& 168& 00000000 nocmd equ $0 169& 00000010 point1 equ $10 170& 00000020 rstrx equ $20 171& 00000030 rsttx equ $30 172& 00000040 rsterr equ $40 173& 00000050 rstint equ $50 Motorola M68000 Assembler Page 5 174& 00000060 brkon equ $60 175& 00000070 brkoff equ $70 176& 177& * transmitter 178& 179& 00000000 tnoop equ $0 180& 00000004 ten equ $4 181& 00000008 tdis equ $8 182& 183& * receiver 184& 185& 00000000 rnoop equ $0 186& 00000001 ren equ $1 187& 00000002 rdis equ $2 188& 189& * interupts 190& 00000000 noints equ $0 191& 192& * output config 193& 00000000 allout equ $0 194& 195& * status register bits 196& 197& 00000080 break equ $80 198& 00000040 frame equ $40 199& 00000020 parity equ $20 200& 00000010 overrun equ $10 201& 00000008 txempty equ $8 202& 00000004 txready equ $4 203& 00000002 ffull equ $2 204& 00000001 rxready equ $1 205& 206& * Derived memory addresses 207& 00000200 vecsize equ $200 208& 0001FDFE stack equ ramtop-vecsize-1 209& 210& * 211& 00000000 null equ $00 212& 0000000D cr equ $0d 213& 0000000A lf equ $0a 214& 00000020 space equ $20 215& 00000007 bell equ $07 216& 00000009 tab equ $09 217& * 218& 0000001C netbrk equ $1c * Control-\ 219& * 220& * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 220+ *:*:*:*:*:*:* 221& * 222& 00000400 org $000400 223& * 224& * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 224+ *:*:*:*:*:*:* 225& * 226& * *** ENTRY POINTS *** 227& * 228& * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 228+ *:*:*:*:*:*:* 229& * Motorola M68000 Assembler Page 6 230& 000400 600003F6 normal: bra lprom * goto prompt start 231& 000404 600003BE coldst: bra main * goto restart 232& * 233& * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 233+ *:*:*:*:*:*:* 234& * 235& * Useful routines 236& * 237& * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 237+ *:*:*:*:*:*:* 238& * 239& * INCHR: inputs a character from port 1 240& * returns with carry set if not available 241& * 242& 000408 083900000002 inchr: btst #0,stata * Rx ready? 243& 000410 67000018 beq inchr1 * no, return with carry 244& 000414 103900020007 nchr: move.b rhra,d0 * get char 245& 00041A 083900000002 btst.b #0,stata 246& 000422 66F0 bne nchr 247& 000424 023C00FE and.b #$0fe,ccr * clear carry no error 248& 000428 4E75 rts * return 249& 00042A 003C0001 inchr1: or.b #$01,ccr * set carry 250& 00042E 4E75 rts * return 251& * 252& * INCH: inputs a character from port 1 253& * no echo, char in D0 254& * 255& 000430 4EB80408 inch: jsr inchr * get character 256& 000434 65FA bcs inch * if not available, try again 257& 000436 4E75 rts * return 258& * 259& * INCHR2: as INCH for port 2 260& * 261& 000438 083900000002 inchr2: btst #0,statb_* Rx ready? 262& 000440 67000018 beq inch21 * no, return with carry 263& 000444 103900020017 ichr2: move.b rhrb,d0 * get data 264& 00044A 083900000002 btst.b #0,statb 265& 000452 66F0 bne ichr2 266& 000454 023C00FE and.b #$0fe,ccr * clear carry no error 267& 000458 4E75 rts 268& 00045A 003C0001 inch21: or.b #$01,ccr * error - set carry 269& 00045E 4E75 rts 270& * 271& * INCH2: as INCH for port 2 272& * 273& 000460 4EB80438 inch2: jsr inchr2 * try for char 274& 000464 65FA bcs inch2 * loop if no char available 275& 000466 4E75 rts 276& * 277& * INCHU: inputs a character to D0, [a-z] converted 277+ to [A-Z] 278& * converted to , no echo, uses INCH, regi 278+ ster D0 used 279& * 280& 000468 4EB80430 inchu: jsr inch * get a character 281& 00046C B03C0061 cmp.b #$61,d0 * is it less than "a"? 282& 000470 6D000010 blt inchu1 * yes, continue 283& 000474 B03C007A cmp.b #$7a,d0 * is it greater than "z"? 284& 000478 6E000008 bgt inchu1 * yes, continue Motorola M68000 Assembler Page 7 285& 00047C 903C0020 sub.b #$20,d0 * subtract offset 286& 000480 4E75 rts * return 287& 000482 B03C000A inchu1: cmp.b #lf,d0 * is it LF? 288& 000486 66000006 bne inchu3 * no, continue 289& 00048A 103C000D move.b #cr,d0 * char is CR 290& 00048E 4E75 inchu3: rts * return 291& * 292& * OUTCH: output a character using duart port 1 293& * character in D0, all registers unaffected 294& * 295& 000490 083900020002 outch: btst #2,stata * Tx ready? 296& 000498 67F6 beq outch * no, try again 297& 00049A 13FC00040002 move.b #ten,cmda 298& 0004A2 13C000020007 move.b d0,thra * output character 299& 0004A8 13FC00010002 move.b #ren,cmda 300& 0004B0 4E75 rts * return 301& * 302& * OUTCH2: as OUTCH for auxiliary RS232 port 303& * 304& 0004B2 083900020002 outch2: btst #2,statb * Tx ready? 305& 0004BA 67F6 beq outch2 * no - loop 306& 0004BC 13FC00040002 move.b #ten,cmdb 307& 0004C4 13C000020017 move.b d0,thrb * send char 308& 0004CA 13FC00010002 move.b #ren,cmdb 309& 0004D2 4E75 rts 310& * 311& * PDATA: outputs a string starting at A4, length in 311+ D2 312& * uses OUTCH 313& * 314& 0004D4 2F00 pdata: move.l d0,-(sp) * save D0 315& 0004D6 60000008 bra pdatst * go to count test 316& 0004DA 101C pdatlp: move.b (a4)+,d0 * get op char 317& 0004DC 4EB80490 jsr outch * print char 318& 0004E0 51CAFFF8 pdatst: dbra d2,pdatlp * decrement D2, repeat loop 318+ if not zero 319& 0004E4 201F move.l (sp)+,d0 * restore D0 320& 0004E6 4E75 rts * return 321& * 322& * NEWLN2: output two newlines 323& * 324& 0004E8 4EB804EC newln2: jsr newlin * do #cr,lf; fall through 325& * 326& * NEWLIN: output #cr,lf; uses OUTCH and D0 327& * 328& 0004EC 103C000D newlin: move.b #cr,d0 * get CR 329& 0004F0 4EB80490 jsr outch * output char 330& 0004F4 103C000A move.b #lf,d0 * get LF 331& 0004F8 4EB80490 jsr outch * output char 332& 0004FC 4E75 rts * return 333& * 334& * PSPACx: prints "x" spaces; uses OUTCH and D0 335& * 336& 0004FE 4EB80516 pspac7: jsr pspac1 * fall through 337& 000502 4EB80516 pspac6: jsr pspac1 * 338& 000506 4EB80516 pspac5: jsr pspac1 * 339& 00050A 4EB80516 pspac4: jsr pspac1 * 340& 00050E 4EB80516 pspac3: jsr pspac1 * 341& 000512 4EB80516 pspac2: jsr pspac1 * Motorola M68000 Assembler Page 8 342& 000516 103C0020 pspac1: move.b #space,d0 * get space 343& 00051A 4EB80490 jsr outch * output char 344& 00051E 4E75 rts * return 345& * 346& * PBELL: echo bell character, uses OUTCH and D0 347& * 348& 000520 103C0007 pbell: move.b #bell,d0 * 349& 000524 4EB80490 jsr outch * output bell 350& 000528 4E75 rts * return 351& * 352& * PEQUAL: prints an "=" 353& * 354& 00052A 103C003D pequal: move.b #$3d,d0 * 355& 00052E 4EB80490 jsr outch * output "=" 356& 000532 4E75 rts * return 357& * 358& * POKMS: prints an OK message 359& * 360& 000534 2F00 pokms: move.l d0,-(sp) * save D0 361& 000536 4EB80516 jsr pspac1 * print space 362& 00053A 103C002D move.b #$2d,d0 * 363& 00053E 4EB80490 jsr outch * print '-' 364& 000542 4EB80516 jsr pspac1 * print space 365& 000546 103C004F move.b #$4f,d0 * 366& 00054A 4EB80490 jsr outch * print 'O' 367& 00054E 103C004B move.b #$4b,d0 * 368& 000552 4EB80490 jsr outch * print 'K' 369& 000556 201F move.l (sp)+,d0 * restore D0 370& 000558 4E75 rts * return 371& * 372& * 373& * DECPT: prints a 24 bit number in D1 as a signed d 373+ ecimal 374& * 375& 00055A 7407 decpt: move.l #$07,d2 * count 376& 00055C 263C00989680 move.l #10000000,d3 * compare value 377& 000562 103C002F declp1: move.b #$2f,d0 * digit offset 378& 000566 5200 declp2: add.b #1,d0 * increment digit 379& 000568 9283 sub.l d3,d1 * subtract compare value 380& 00056A 64FA bcc declp2 * repeat if not negative 381& 00056C D283 add.l d3,d1 * overshoot, restore value 382& 00056E 4EB80490 jsr outch * output character from d0 383& 000572 86FC000A divu #10,d3 * divide by 10 384& 000576 51CAFFEA dbra d2,declp1 * decrement count and repeat if not 384+ zero 385& 00057A 4E75 rts * return 386& * 387& * SCH8HX: print value in D1 as 8 hex digits, and SP 387+ ACE 388& * 389& 00057C 4EB80586 sch8hx: jsr ch8hex * print value 390& 000580 4EB80516 jsr pspac1 * print space and fall through 391& 000584 4E75 rts 392& * 393& * CH8HEX: print value in D1 as 8 hex digits 394& * 395& 000586 2F01 ch8hex: move.l d1,-(sp) * save value 396& 000588 E089 lsr.l #8,d1 397& 00058A E089 lsr.l #8,d1 * get msw to lsw Motorola M68000 Assembler Page 9 398& 00058C 4EB805C0 jsr ch4hex * print msw 399& 000590 221F move.l (sp)+,d1 * restore value 400& 000592 4EB805C0 jsr ch4hex * print lsw and space 401& 000596 4E75 rts 402& * 403& * SCH6HX: print value in D1 as 6 hex digits, and SP 403+ ACE 404& * 405& 000598 4EB805B6 sch6hx: jsr ch6hex * print number 406& 00059C 4EB80516 jsr pspac1 * space 407& 0005A0 4E75 rts 408& * 409& * SCH4HX: print value in D1 as hex digits, and SPAC 409+ E 410& * 411& 0005A2 4EB805C0 sch4hx: jsr ch4hex * print value 412& 0005A6 4EB80516 jsr pspac1 * print 1 space 413& 0005AA 4E75 rts * return 414& * 415& * SCH2HX: print value in D0 as hex digits, and spac 415+ e 416& * 417& 0005AC 4EB805CA sch2hx: jsr ch2hex * print value 418& 0005B0 4EB80516 jsr pspac1 * print 1 space 419& 0005B4 4E75 rts * return 420& * 421& * CH6HEX: print value in D1 as 6 hex digits 422& * uses D0 register 423& * 424& 0005B6 2001 ch6hex: move.l d1,d0 425& 0005B8 E088 lsr.l #8,d0 * 426& 0005BA E088 lsr.l #8,d0 * move top byte to lsb of d0 427& 0005BC 4EB805CA jsr ch2hex * print it and drop through 428& * 429& * CH4HEX: print value in D1 as 4 hex digits 430& * uses D0 register 431& * 432& 0005C0 3001 ch4hex: move.w d1,d0 * get msb 433& 0005C2 E048 lsr.w #8,d0 * move msb to lsb of d0 434& 0005C4 4EB805CA jsr ch2hex * print it 435& 0005C8 1001 move.b d1,d0 * get lsb and drop through 436& * 437& * CH2HEX: print value in D0 as two hex digits 438& * 439& 0005CA 2F00 ch2hex: move.l d0,-(sp) * save value 440& 0005CC 4EB805D8 jsr hihex * print ms 4 bits 441& 0005D0 201F move.l (sp)+,d0 * restore value 442& 0005D2 4EB805E0 jsr lohex * print ls 4 bits 443& 0005D6 4E75 rts * return 444& * 445& * HIHEX: print MS four bits of D0 as hexadecimal di 445+ git 446& * 447& 0005D8 E918 hihex: rol.b #4,d0 * swap nibbles 448& 0005DA 4EB805E0 jsr lohex * print it 449& 0005DE 4E75 rts * return 450& * 451& * LOHEX: print LS four bits in D0 as hex digit 452& * Motorola M68000 Assembler Page 10 453& 0005E0 C03C000F lohex: and.b #$0f,d0 * clear top 4 bits 454& 0005E4 B03C000A cmp.b #10,d0 * greater than 10? 455& 0005E8 6C00000C bge lohex1 * yes, continue 456& 0005EC D03C0030 add.b #$30,d0 * add char offset 457& 0005F0 4EB80490 lohex2: jsr outch * output char 458& 0005F4 4E75 rts * return 459& 0005F6 D03C0037 lohex1: add.b #$41-10,d0 * add "A"-10 460& 0005FA 60F4 bra lohex2 * continue 461& * 462& * CHKEVN: checks if D1 even, if so rts with carry c 462+ lear 463& * if not, prints message and rts with carry set 464& * 465& 0005FC 08010000 chkevn: btst #0,d1 * test d1 bottom bit 466& 000600 6700001A beq even * branch if even 467& 000604 4EB80520 jsr pbell * sound bell 468& 000608 49F819D6 lea oddms,a4 * pointer to message 469& 00060C 243C0000001A move.l #oddmn-oddms,d2 * msg length 470& 000612 4EB804D4 jsr pdata * print message 471& 000616 003C0001 or.b #$01,ccr * set carry 472& 00061A 4E75 rts 473& 00061C 023C00FE even: and.b #$0fe,ccr * unset carry 474& 000620 4E75 rts 475& * 476& * SIN8HX: output a space, and input 8 hex chars to 476+ D1 477& * 478& 000622 4EB80516 sin8hx: jsr pspac1 * print a space & fall through 479& * 480& * IN8HEX: inputs 8 hex chars to D1. Return with car 480+ ry set if 481& * 482& 000626 4EB80652 in8hex: jsr in4hex * get 4 digits to D1 483& 00062A 6500003C bcs in4hx * return if carry set 484& 00062E E189 lsl.l #8,d1 485& 000630 E189 lsl.l #8,d1 * shift to msw 486& 000632 6000001E bra in4hex * get rest 487& * 488& * SIN6HX: output a space, and input 6 hex chars to 488+ D1, msb cleared 489& * 490& 000636 4EB80516 sin6hx: jsr pspac1 * print a space & fall through 491& * 492& * IN6HEX: inputs 6 hex chars to D1* returns with ca 492+ rry set if 493& * msb of D1 cleared 494& * 495& 00063A 4281 in6hex: clr.l d1 * initialize 496& 00063C 4EB8066E jsr in2hex * get 2 hex digits 497& 000640 65000026 bcs in4hx * return if carry 498& 000644 1200 move.b d0,d1 499& 000646 E189 lsl.l #8,d1 * 500& 000648 E189 lsl.l #8,d1 * shift to correct d1 byte 501& 00064A 60000006 bra in4hex * get rest 502& * 503& * SIN4HX: output a space, and input 4 hex chars 504& * 505& 00064E 4EB80516 sin4hx: jsr pspac1 * print a space* fall through 506& * Motorola M68000 Assembler Page 11 507& * IN4HEX: inputs 4 hex chars to D1* returns with ca 507+ rry set if 508& * 509& 000652 4EB8066E in4hex: jsr in2hex * get 2 hex digits 510& 000656 65000010 bcs in4hx * return if carry 511& 00065A E148 lsl.w #8,d0 * shift it up to msb 512& 00065C 3200 move.w d0,d1 * save in d1 513& 00065E 4EB8066E jsr in2hex * get 2 hex digits 514& 000662 65000004 bcs in4hx * return if carry 515& 000666 1200 move.b d0,d1 * move to lsb 516& 000668 4E75 in4hx: rts * return 517& * 518& * SIN2HX: print space, and get 2 hex digits into D0 518+ ; set carry if 519& * 520& 00066A 4EB80516 sin2hx: jsr pspac1 * print space and drop through 521& * 522& * IN2HEX: get 2 hex digits into D0* return with car 522+ ry set if 523& * 524& 00066E 4EB806A4 in2hex: jsr in1hex * get first hex digit 525& 000672 6500002A bcs in2hx9 * return if carry set 526& 000676 2F01 in2hax: move.l d1,-(sp) * save D1 527& 000678 C03C000F and.b #$0f,d0 * clear ms nibble 528& 00067C E918 rol.b #4,d0 * swap nibbles 529& 00067E 2F00 move.l d0,-(sp) * save D0 530& 000680 4EB806A4 jsr in1hex * get second hex digit 531& 000684 65000014 bcs in2hx8 * return if carry set 532& 000688 1200 move.b d0,d1 * save LS nibble 533& 00068A 201F move.l (sp)+,d0 * get MS nibble 534& 00068C C23C000F and.b #$0f,d1 * clear MS bits 535& 000690 D001 add.b d1,d0 * add nibbles 536& 000692 221F move.l (sp)+,d1 * restore D1 537& 000694 023C00FE and.b #$0fe,ccr * clear carry bit 538& 000698 4E75 rts * return 539& 00069A 201F in2hx8: move.l (sp)+,d0 * 540& 00069C 201F move.l (sp)+,d0 * clean up stack 541& 00069E 003C0001 in2hx9: or.b #$01,ccr * set carry 542& 0006A2 4E75 rts * return 543& * 544& * IN1HEX: get 1 hexadecimal character into D0* sets 544+ carry if 545& * 546& 0006A4 4EB80468 in1hex: jsr inchu * get upper-case character 547& 0006A8 B03C0030 cmp.b #$30,d0 * is it less than "0"? 548& 0006AC 6D000036 blt in1er1 * yes, possible error 549& 0006B0 B03C0039 cmp.b #$39,d0 * is it greater than "9"? 550& 0006B4 6E000010 bgt in1er2 * yes, possible error 551& 0006B8 4EB80490 jsr outch * echo char 552& 0006BC 903C0030 sub.b #$30,d0 * subtract offset 553& 0006C0 023C00FE and.b #$0fe,ccr * clear carry bit 554& 0006C4 4E75 rts * return 555& 0006C6 B03C0041 in1er2: cmp.b #$41,d0 * is it less than "A"? 556& 0006CA 6D000020 blt in1err * yes, error 557& 0006CE B03C0046 cmp.b #$46,d0 * is it greater than "F"? 558& 0006D2 6E000018 bgt in1err * yes, error 559& 0006D6 4EB80490 jsr outch * output char 560& 0006DA 903C0037 sub.b #$41-10,d0 * subtract char offset 561& 0006DE 023C00FE and.b #$0fe,ccr * clear carry Motorola M68000 Assembler Page 12 562& 0006E2 4E75 rts * return 563& 0006E4 B03C000D in1er1: cmp.b #cr,d0 * is it CR? 564& 0006E8 67000008 beq in1cr * yes, continue 565& 0006EC 4EB80520 in1err: jsr pbell * output bell 566& 0006F0 60B2 bra in1hex * try again 567& 0006F2 4EB80490 in1cr: jsr outch * echo character 568& 0006F6 003C0001 or.b #$01,ccr * set carry 569& 0006FA 4E75 rts * return 570& * 571& * HINCH: gets a character - if lnkflg = 00 gets cha 571+ r from network, 572& * echos and acknowledges it; if lnkflg <> 00 gets c 572+ har from 573& * auxiliary RS232 port; 574& * char got to d0, all other registers unaffected, c 574+ lears top bit of char 575& * 576& 0006FC 4EB80460 hinch: jsr inch2 * get char from aux RS232 577& 000700 C03C007F and.b #$7f,d0 * clear top bit 578& 000704 4E75 rts * return 579& * 580& * HINCHR: gets an UPPER-CASE character from network 580+ interface to D0 581& * converted to , uses HINCH routin 581+ e 582& * 583& 000706 4EB806FC hinchr: jsr hinch * get character 584& 00070A B03C0061 cmp.b #$61,d0 * is it less than "a"? 585& 00070E 6D000010 blt hincu1 * yes, continue 586& 000712 B03C007A cmp.b #$7a,d0 * is it greater than "z"? 587& 000716 6E000008 bgt hincu1 * yes, continue 588& 00071A 903C0020 sub.b #$20,d0 * subtract character offset 589& 00071E 4E75 rts * return 590& 000720 B03C000A hincu1: cmp.b #lf,d0 * is it ? 591& 000724 66000006 bne hincu3 * no, continue 592& 000728 103C000D move.b #cr,d0 * character is 593& 00072C 4E75 hincu3: rts * return 594& * 595& * HIN1HX: gets a hexadecimal character from network 595+ interface to D0 596& * uses HINCHR routine, return with carry se 596+ t if 597& * other characters ignored 598& * 599& 00072E 4EB80706 hin1hx: jsr hinchr * get character 600& 000732 B03C0030 cmp.b #$30,d0 * is it less than "0"? 601& 000736 6D00002E blt hin1e1 * yes, possible error 602& 00073A B03C0039 cmp.b #$39,d0 * is it greater than "9"? 603& 00073E 6E00000C bgt hin1e2 * yes, possible error 604& 000742 903C0030 sub.b #$30,d0 * subtract offset 605& 000746 023C00FE and.b #$0fe,ccr * clear carry 606& 00074A 4E75 rts * return 607& 00074C B03C0041 hin1e2: cmp.b #$41,d0 * is it less than "A"? 608& 000750 6D000022 blt hin1er * yes, error 609& 000754 B03C0046 cmp.b #$46,d0 * is it greater than "F"? 610& 000758 6E00001A bgt hin1er * yes, error 611& 00075C 903C0037 sub.b #$41-10,d0 * subtract offset 612& 000760 023C00FE and.b #$0fe,ccr * clear carry 613& 000764 4E75 rts * return Motorola M68000 Assembler Page 13 614& 000766 B03C000D hin1e1: cmp.b #cr,d0 * is it ? 615& 00076A 66000008 bne hin1er * no, error 616& 00076E 003C0001 or.b #$01,ccr * set carry 617& 000772 4E75 rts * return 618& 000774 60B8 hin1er: bra hin1hx * try again 619& * 620& * HIN2HX: gets 2 hexadecimal characters into D0 fro 620+ m network 621& * All other registers preserved 622& * return with carry set if 623& * 624& 000776 4EB8072E hin2hx: jsr hin1hx * get 1 hex char 625& 00077A 65000024 bcs hin2h9 * if carry set, return 626& 00077E 2F01 move.l d1,-(sp) * save D1 627& 000780 C03C000F and.b #$0f,d0 * clear ms nibble 628& 000784 E918 rol.b #4,d0 * swap nibbles 629& 000786 2F00 move.l d0,-(sp) * save D0 (1st char) 630& 000788 4EB8072E jsr hin1hx * get second hex char 631& 00078C 65000014 bcs hin2h8 * return if carry set 632& 000790 1200 move.b d0,d1 * save ls nibble 633& 000792 201F move.l (sp)+,d0 * restore D0 634& 000794 C23C000F and.b #$0f,d1 * clear ms nibble 635& 000798 D001 add.b d1,d0 * combine nibbles 636& 00079A 221F move.l (sp)+,d1 * restore D1 637& 00079C 023C00FE and.b #$0fe,ccr * clear carry 638& 0007A0 4E75 hin2h9: rts * 639& 0007A2 201F hin2h8: move.l (sp)+,d0 * 640& 0007A4 201F move.l (sp)+,d0 * clean up stack 641& 0007A6 003C0001 or.b #$01,ccr * set carry 642& 0007AA 4E75 rts * return 643& * 644& * HIN4HX: gets 4 hex characters from network into D 644+ 1 645& * uses HIN2HX routine, returns with carry s 645+ et if 646& * 647& 0007AC 4EB80776 hin4hx: jsr hin2hx * get 2 chars 648& 0007B0 65000010 bcs hin4hr * return if carry 649& 0007B4 1200 move.b d0,d1 650& 0007B6 E149 lsl.w #8,d1 * shift to msb of d1 651& 0007B8 4EB80776 jsr hin2hx * get 2 chars 652& 0007BC 65000004 bcs hin4hr * return if carry 653& 0007C0 1200 move.b d0,d1 * move to lsb 654& 0007C2 4E75 hin4hr: rts * return 655& * 656& * 657& * 658& end 30 * 31 * 32 * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 32+ *:*:*:*:*:*:* 33 * 34 * INITIALISATION code 35 * 36 * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 36+ *:*:*:*:*:*:* 37 * 38 * Motorola M68000 Assembler Page 14 39 0007C4 4EB811BE main: jsr inits * initialise 40 * 41 * INITIALIZE saved register frame 42 * 43 * sets A0 to point at top of frame. D0-7/A0-6 clear 43+ ed, A7(SSP) 44 * points to SR,SR: ints disabled, supervisor mode, 44+ trace on 45 * PC :=stoplp,USP :=$016ffe 46 * note this code cannot be put in a subroutine as a 46+ dds to stack 47 * 48 0007C8 487810D2 pea stoplp * set up pc 49 0007CC 40E7 move.w sr,-(sp) * save sr 50 0007CE 0057A700 or.w #$0a700,(sp) * ints disabled,sup. mode, trace 50+ on 51 0007D2 2F0F move.l sp,-(sp) * save sp 52 0007D4 740E move.l #14,d2 * 15 more registers to save 53 0007D6 2F3C00000000 pushlp: move.l #0,-(sp) * save zero long word 54 0007DC 51CAFFF8 dbra d2,pushlp * repeat as rqd 55 0007E0 204F move.l sp,a0 * set a0 to point at frame 56 0007E2 287C00016FFE move.l #$016ffe,a4 * init usp 57 0007E8 4E64 move.l a4,usp 58 * 59 * move.b #$00,brkflg * reset breakpoint flag 60 * move.b #$00,remflg * reset network connection fla 60+ g 61 * move.b #$00,pakflg * reset packet available flag 62 * move.b #$0ff,cntflg * set all packet control line 62+ s high 63 * move.b cntflg,pacnt * copy to O/P port 64 * 65 0007EA 49F812BE lea intros,a4 * 66 0007EE 243C0000007E move.l #intron-intros,d2 * get message length 67 0007F4 4EB804D4 jsr pdata * print introductory message 68 * 69 * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 69+ *:*:*:*:*:*:* 70 * 71 * Main command interpreter routine 72 * 73 * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 73+ *:*:*:*:*:*:* 74 * 75 0007F8 49F8133C lprom: lea promms,a4 * 76 0007FC 243C0000000A move.l #prommn-promms,d2 * get message length 77 000802 4EB804D4 jsr pdata * print prompt 78 000806 4EB80468 chinp: jsr inchu * get an upper-case character 79 00080A B03C000D cmp.b #cr,d0 * is it ? 80 00080E 67E8 beq lprom * yes, goto prompt 81 000810 B03C003F cmp.b #$3f,d0 * is it "?"? 82 000814 670000A2 beq query * yes, goto query 83 000818 B03C0041 cmp.b #$41,d0 * is it "A"? 84 00081C 67000260 beq arith * yes, goto arithmetic 85 000820 B03C0042 cmp.b #$42,d0 * is it "B"? 86 000824 67000676 beq brkpt * yes, goto set breakpoint 87 000828 B03C0043 cmp.b #$43,d0 * is it "C"? 88 00082C 670000A0 beq copyr * yes, goto copy routine 89 000830 B03C0044 cmp.b #$44,d0 * is it "D"? Motorola M68000 Assembler Page 15 90 000834 670001AE beq displ * yes, goto display routine 91 000838 B03C0046 cmp.b #$46,d0 * is it "F"? 92 00083C 670000CE beq fillm * yes, goto fill memory routine 93 000840 B03C0047 cmp.b #$47,d0 * is it "G"? 94 000844 6700029C beq goprg * yes, goto program routine 95 000848 B03C0048 cmp.b #$48,d0 * is it "H"? 96 00084C 67000210 beq hexdc * yes, goto hex -> decimal routine 97 000850 B03C0049 cmp.b #$49,d0 * is it "I"? 98 000854 670002B2 beq diffr * yes, goto difference routine 99 000858 B03C004A cmp.b #$4a,d0 * is it "J"? 100 00085C 670003E6 beq findr * yes, goto find routine 101 000860 B03C004B cmp.b #$4b,d0 * is it "K"? 102 000864 6700068E beq killbp * yes, goto kill breakpoint 103 * cmp.b #$4c,d0 * is it "L"? 104 * beq loadr * yes, goto load routine 105 000868 B03C004D cmp.b #$4d,d0 * is it "M"? 106 00086C 670000CA beq modif * yes, goto modify memory routine 107 000870 B03C0050 cmp.b #$50,d0 * is it "P"? 108 000874 67000396 beq rslink * yes, goto RS232 link routine 109 * cmp.b #$51,d0 * is it "Q"? 110 * beq discn0 * yes, goto disconnection routine 111 000878 B03C0052 cmp.b #$52,d0 * is it "R"? 112 00087C 670005A6 beq regsr * yes, goto register routine 113 * cmp.b #$53,d0 * is it "S"? 114 * beq reqcon * yes, goto request connection routine 115 000880 B03C0054 cmp.b #$54,d0 * is it "T"? 116 000884 6700048E beq tstmem * yes, goto test memory 117 000888 B03C0055 cmp.b #$55,d0 * is it "U"? 118 00088C 670006C2 beq setreg * yes, goto register set routine 119 000890 B03C0056 cmp.b #$56,d0 * is it "V"? 120 000894 67000408 beq compr * yes, goto compare routine 121 * cmp.b #$57,d0 * is it "W"? 122 * beq where * yes, goto where connected routine 123 000898 B03C0058 cmp.b #$58,d0 * is it "X"? 124 00089C 67000802 beq xtrace * yes, goto trace routine 125 0008A0 B03C005A cmp.b #$5a,d0 * is it "Z"? 126 0008A4 6700081E beq ztrace * yes, goto single step routine 127 * 128 * character not found 129 * 130 0008A8 4EB80520 jsr pbell * char not found, print bell 131 0008AC 6000FF58 bra chinp * get next char 132 * 133 * Command Jump table 134 * 135 0008B0 4EB80490 lprom1: jsr outch * echo character 136 0008B4 6000FF42 bra lprom * goto prompt 137 * 138 * QUERY: print help message* uses D1, D0 139 * 140 0008B8 4EB80490 query: jsr outch * output character 141 0008BC 49F81346 lea helpms,a4 * get message pointer 142 0008C0 243C0000046E move.l #helpmn-helpms,d2 * get message length 143 0008C6 4EB804D4 jsr pdata * print it 144 0008CA 6000FF2C bra lprom * goto prompt 145 * 146 * Copy memory routine 147 * 148 0008CE 4EB80490 copyr: jsr outch * echo char Motorola M68000 Assembler Page 16 149 0008D2 4EB80636 jsr sin6hx * get start address 150 0008D6 65000030 bcs lprom3 * if carry set, goto prompt 151 0008DA 2C41 move.l d1,a6 * save address 152 0008DC 4EB80636 jsr sin6hx * get end address 153 0008E0 65000026 bcs lprom3 * if carry set, goto prompt 154 0008E4 2601 move.l d1,d3 * save address 155 0008E6 49F817B4 lea arrms,a4 * message pointer 156 0008EA 243C00000004 move.l #arrmn-arrms,d2 * message length 157 0008F0 4EB804D4 jsr pdata * print message 158 0008F4 4EB80636 jsr sin6hx * get destination address 159 0008F8 6500000E bcs lprom3 * if carry set, goto prompt 160 0008FC 2A41 move.l d1,a5 * dest. string pointer 161 0008FE 2403 move.l d3,d2 * 162 000900 948E sub.l a6,d2 * calculate length 163 000902 1ADE cpylp: move.b (a6)+,(a5)+ * move byte, update ptrs 164 000904 51CAFFFC cptst: dbra d2,cpylp * repeat as rqd 165 000908 6000FEEE lprom3: bra lprom * goto prompt 166 * 167 * FILLM: fills memory with value 168 * 169 00090C 4EB80490 fillm: jsr outch * echo character 170 000910 4EB80636 jsr sin6hx * get start address 171 000914 65F2 bcs lprom3 * goto prompt 172 000916 2A41 move.l d1,a5 * save address 173 000918 4EB80636 jsr sin6hx * get end address 174 00091C 65EA bcs lprom3 * if carry set, goto prompt 175 00091E 2401 move.l d1,d2 * 176 000920 948D sub.l a5,d2 * calculate length 177 000922 4EB80516 jsr pspac1 * print space 178 000926 4EB8052A jsr pequal * print equ 179 00092A 4EB8066A jsr sin2hx * get value 180 00092E 65D8 bcs lprom3 * if carry set, goto prompt 181 000930 1AC0 filllp: move.b d0,(a5)+ * set byte 182 000932 51CAFFFC flltst: dbra d2,filllp * repeat as rqd 183 000936 60D0 bra lprom3 * goto prompt 184 * 185 * MODIF: modify memory locations 186 * 187 000938 4EB80490 modif: jsr outch * echo character 188 00093C 4EB80636 jsr sin6hx * get address 189 000940 65000074 bcs lprm19 * if carry set, goto prompt 190 000944 2841 move.l d1,a4 * save address 191 000946 4EB804EC modf2: jsr newlin * do CR, LF 192 00094A 220C move.l a4,d1 * get current address 193 00094C 4EB80598 jsr sch6hx * print it 194 000950 1014 move.b (a4),d0 * get present value 195 000952 4EB805AC jsr sch2hx * print it 196 000956 4EB80468 modf5: jsr inchu * get character 197 00095A B03C000D cmp.b #cr,d0 * is it CR? 198 00095E 6700007C beq lprm29 * yes, goto prompt 199 000962 B03C0020 cmp.b #space,d0 * is it space? 200 000966 6600000A bne modf1 * no, modify value 201 00096A 4EB80490 modf6: jsr outch * echo character 202 00096E 528C modf9: add.l #1,a4 * increment pointer 203 000970 60D4 bra modf2 * continue 204 000972 B03C002D modf1: cmp.b #$2d,d0 * is it '-'? 205 000976 6600000A bne modf3 * no, new value 206 00097A 4EB80490 jsr outch * echo character 207 00097E 538C sub.l #1,a4 * back up pointer Motorola M68000 Assembler Page 17 208 000980 60C4 bra modf2 * continue 209 000982 B03C0030 modf3: cmp.b #$30,d0 * is it less than '0'? 210 000986 6D00004C blt moder4 * yes, error 211 00098A B03C0039 cmp.b #$39,d0 * is it greater than '9'? 212 00098E 6E00002A bgt moder2 * yes, possible error 213 000992 4EB80490 jsr outch * echo char 214 000996 903C0030 sub.b #$30,d0 * subtract offset 215 00099A 4EB80676 modf4: jsr in2hax * get rest of value 216 00099E 65000016 bcs lprm20 * if carry set, goto prompt 217 0009A2 1880 move.b d0,(a4) * update value 218 0009A4 B014 cmp.b (a4),d0 * are they equal?? 219 0009A6 67C6 beq modf9 * yes, next value 220 0009A8 49F817B8 lea wrerms,a4 * pointer to message 221 0009AC 243C0000000E move.l #wrermn-wrerms,d2 * get length 222 0009B2 4EB804D4 jsr pdata * print message 223 0009B6 6000FE40 lprm19: bra lprom * goto prompt 224 000009B6 lprm20 equ lprm19 225 0009BA B03C0041 moder2: cmp.b #$41,d0 * is it less than "A"? 226 0009BE 6D000014 blt moder4 * yes, error 227 0009C2 B03C0046 cmp.b #$46,d0 * is it greater than "F"? 228 0009C6 6E00000C bgt moder4 * yes, error 229 0009CA 4EB80490 jsr outch * print char 230 0009CE 903C0037 sub.b #$37,d0 * subtract char offset 231 0009D2 60C6 bra modf4 * continue 232 0009D4 4EB80520 moder4: jsr pbell * print bell 233 0009D8 6000FF7C bra modf5 * continue 234 0009DC 4EB80490 lprm29: jsr outch * echo character 235 0009E0 6000FE16 bra lprom * goto prompt 236 * 237 * Display memory routine 238 * 239 0009E4 4EB80490 displ: jsr outch * echo char 240 0009E8 4EB80636 jsr sin6hx * get address 241 0009EC 65C8 bcs lprm19 * if carry set, goto prompt 242 0009EE 2841 move.l d1,a4 * start of block pointer in A4 243 0009F0 4EB804E8 jsr newln2 * 2x #cr, lf 244 0009F4 4EB804FE jsr pspac7 * 5 spaces 245 0009F8 740F move.l #$0f,d2 * count 246 0009FA 220C move.l a4,d1 * get start of block 247 0009FC 4EB80512 dislp1: jsr pspac2 * 2 spaces 248 000A00 1001 move.b d1,d0 * get lsb 249 000A02 4EB805E0 jsr lohex * print lsb hex char 250 000A06 5201 add.b #1,d1 * increment value 251 000A08 51CAFFF2 dbra d2,dislp1 * decrement and repeat if not zero 252 000A0C 4EB804E8 jsr newln2 * 2x #cr, lf 253 000A10 363C000F move.w #$0f,d3 * row counter - 1 254 000A14 220C dislp2: move.l a4,d1 * block address 255 000A16 4EB80598 jsr sch6hx * print it 256 000A1A 4EB80516 jsr pspac1 * print space 257 000A1E 740F move.l #$0f,d2 * byte count - 1 258 000A20 101C dislp3: move.b (a4)+,d0 * get value 259 000A22 4EB805AC jsr sch2hx * print value 260 000A26 51CAFFF8 dbra d2,dislp3 * decrement and repeat if not zero 261 000A2A 4EB80512 jsr pspac2 * 2x space 262 000A2E 98FC0010 sub.w #$10,a4 * back up pointer 263 000A32 740F move.l #$0f,d2 * byte count - 1 264 000A34 101C dislp4: move.b (a4)+,d0 * get char 265 000A36 B03C0020 cmp.b #space,d0 * is it less than space? 266 000A3A 6D00000A blt dispn1 * yes, continue Motorola M68000 Assembler Page 18 267 000A3E B03C007E cmp.b #$7e,d0 * is it greater than "~"? 268 000A42 6F000006 ble dispn2 * no, continue 269 000A46 103C002E dispn1: move.b #$2e,d0 * get "." 270 000A4A 4EB80490 dispn2: jsr outch * print character 271 000A4E 51CAFFE4 dbra d2,dislp4 * decrement and repeat if not zero 272 000A52 4EB804EC jsr newlin * do CR, LF 273 000A56 51CBFFBC dbra d3,dislp2 * decrement row count and rpt if rq 273+ d 274 000A5A 6000FD9C lprom6: bra lprom * goto prompt 275 * 276 * HEXDC: convert to decimal 277 * 278 000A5E 4EB80490 hexdc: jsr outch * echo character 279 000A62 4EB80636 jsr sin6hx * get hex value 280 000A66 65000012 bcs lprm14 * if carry set, goto prompt 281 000A6A 4EB80516 jsr pspac1 * print space 282 000A6E 4EB8052A jsr pequal * print "equ" 283 000A72 4EB80516 jsr pspac1 * print space 284 000A76 4EB8055A jsr decpt * print as decimal number 285 000A7A 60000062 lprm14: bra lprom2 * goto prompt 286 * 287 * ARITH: does hex arithmetic 288 * 289 000A7E 4EB80490 arith: jsr outch * output character 290 000A82 4EB80636 jsr sin6hx * get 24 bit word 291 000A86 65000056 bcs lprom2 * if carry set, goto prompt 292 000A8A 2401 move.l d1,d2 * save first 293 000A8C 4EB80636 jsr sin6hx * get 24 bit word 294 000A90 6500004C bcs lprom2 * if carry set, goto prompt 295 000A94 2601 move.l d1,d3 * save second 296 000A96 4EB804EC jsr newlin * do CR, LF 297 000A9A 2202 move.l d2,d1 * get first 298 000A9C 4EB805B6 jsr ch6hex * print first 299 000AA0 103C002B move.b #$2b,d0 * 300 000AA4 4EB80490 jsr outch * print "+" 301 000AA8 2203 move.l d3,d1 * get second 302 000AAA 4EB805B6 jsr ch6hex * print second 303 000AAE 4EB8052A jsr pequal * print = 304 000AB2 2203 move.l d3,d1 * get second 305 000AB4 D282 add.l d2,d1 * add first 306 000AB6 4EB805B6 jsr ch6hex * output sum 307 000ABA 4EB804EC jsr newlin * do CR, LF 308 000ABE 2202 move.l d2,d1 * get first 309 000AC0 4EB805B6 jsr ch6hex * print first 310 000AC4 103C002D move.b #$2d,d0 * 311 000AC8 4EB80490 jsr outch * print "-" 312 000ACC 2203 move.l d3,d1 * get second 313 000ACE 4EB805B6 jsr ch6hex * print second 314 000AD2 4EB8052A jsr pequal * print "=" 315 000AD6 2202 move.l d2,d1 * get first 316 000AD8 9283 sub.l d3,d1 * subtract second 317 000ADA 4EB805B6 jsr ch6hex * output difference 318 000ADE 6000FD18 lprom2: bra lprom * goto prompt 319 * 320 * GOPRG: start user program 321 * 322 000AE2 4EB80490 goprg: jsr outch * echo char 323 000AE6 4EB80636 jsr sin6hx * get address 324 000AEA 65F2 bcs lprom2 * if carry set, goto prompt Motorola M68000 Assembler Page 19 325 000AEC 4EB805FC jsr chkevn * if not even prints msg, sets carry 326 000AF0 65EC bcs lprom2 * address wasnt even 327 000AF2 4EB804EC jsr newlin * do cr,lf 328 000AF6 21410042 move.l d1,66(a0) * go address into saved pc 329 000AFA 02687FFF0040 and.w #$7fff,64(a0) * unset trace in saved sr 330 000B00 2E48 move.l a0,sp * set sp to saved reg. frame 331 000B02 4CDFFFFF movem.l (sp)+,d0-d7/a0-a6/sp * restore registers 332 000B06 4E73 rte * go 333 * 334 * DIFFR: finds first location different from a valu 334+ e 335 * 336 000B08 4EB80490 diffr: jsr outch * echo character 337 000B0C 4EB80636 jsr sin6hx * get first value 338 000B10 6500004C bcs lprm10 * if carry set, goto prompt 339 000B14 2A41 move.l d1,a5 * start address 340 000B16 4EB80636 jsr sin6hx * get second value 341 000B1A 65000042 bcs lprm10 * if carry set, goto prompt 342 000B1E 2401 move.l d1,d2 * end address 343 000B20 948D sub.l a5,d2 * calculate length 344 000B22 4EB80516 jsr pspac1 * output space 345 000B26 4EB8052A jsr pequal * output "=" 346 000B2A 4EB8066A jsr sin2hx * get value 347 000B2E 6500002E bcs lprm10 * if carry set, goto prompt 348 000B32 B01D difflp: cmp.b (a5)+,d0 * scan memory 349 000B34 6600000E bne difdif * if values different, report 350 000B38 51CAFFF8 diftst: dbra d2,difflp * decrement and repeat if no 350+ t zero 351 000B3C 4EB80534 jsr pokms * print OK message 352 000B40 6000FCB6 bra lprom * goto prompt 353 000B44 4EB804EC difdif: jsr newlin * do #cr, lf 354 000B48 538D sub.l #1,a5 * decrement pointer 355 000B4A 220D move.l a5,d1 * get different address 356 000B4C 4EB80598 jsr sch6hx * print address 357 000B50 4EB8052A jsr pequal * print "=" 358 000B54 4EB80516 jsr pspac1 * print space 359 000B58 1015 move.b (a5),d0 * get value 360 000B5A 4EB805CA jsr ch2hex * print value 361 000B5E 6000FC98 lprm10: bra lprom * goto prompt 362 * 363 * 364 * Load program from remote device 365 * 366 000B62 4EB80490 ploadr: jsr outch * echo command char 367 000B66 4EB806FC pload1: jsr hinch * get char from network 368 000B6A B03C0053 cmp.b #$53,d0 * is it "S"? 369 000B6E 66F6 bne pload1 * no, try again 370 000B70 4EB80490 jsr outch * output "S" 371 000B74 4EB806FC jsr hinch * get record type no (1,2 or 9) 372 000B78 B03C0031 cmp.b #$31,d0 * is it 1? 373 000B7C 67000016 beq shadd * yes, short address version 374 000B80 B03C0032 cmp.b #$32,d0 * is it 2? 375 000B84 67000042 beq lngadd * yes, long address version 376 000B88 B03C0039 cmp.b #$39,d0 * is it 9? 377 000B8C 67000058 beq windup * yes, download ending 378 000B90 6000006E bra lprm70 * abort if any other character 379 000B94 4EB80776 shadd: jsr hin2hx * get record length 380 000B98 65000066 bcs lprm70 * prompt if 381 000B9C 4282 clr.l d2 Motorola M68000 Assembler Page 20 382 000B9E 1400 move.b d0,d2 * record length in D2 383 000BA0 5982 sub.l #4,d2 * adjust it to count data only 384 000BA2 4283 clr.l d3 * clear address pointer 385 000BA4 4EB807AC shad2: jsr hin4hx * get address 386 000BA8 65000056 bcs lprm70 * prompt if 387 000BAC 3601 move.w d1,d3 * put addr in pointer 388 000BAE 2843 move.l d3,a4 * move it to a4 389 000BB0 4EB80776 getbyt: jsr hin2hx * get data byte 390 000BB4 6500004A bcs lprm70 * prompt if 391 000BB8 18C0 move.b d0,(a4)+ * put in memory 392 000BBA 51CAFFF4 dbra d2,getbyt * repeat as rqd 393 000BBE 4EB80776 jsr hin2hx * throw away checksum 394 000BC2 6500003C bcs lprm70 * prompt if 395 000BC6 609E bra pload1 * get next record 396 000BC8 4EB80776 lngadd: jsr hin2hx * get record length 397 000BCC 65000032 bcs lprm70 * prompt if 398 000BD0 4282 clr.l d2 399 000BD2 1400 move.b d0,d2 * record length into d2 400 000BD4 5B82 sub.l #5,d2 * adjust to count data only 401 000BD6 4283 clr.l d3 402 000BD8 4EB80776 jsr hin2hx * get msb of addr to d0 403 000BDC 65000022 bcs lprm70 * prompt if 404 000BE0 1600 move.b d0,d3 * put it in d3 405 000BE2 4843 swap d3 * move it to correct byte of d3 406 000BE4 60BE bra shad2 * continue 407 000BE6 4EB807AC windup: jsr hin4hx 408 000BEA 4EB807AC jsr hin4hx * throw away 4 bytes 409 000BEE 49F819F0 lea lfinms,a4 * load finished message 410 000BF2 243C00000012 move.l #lfinmn-lfinms,d2 411 000BF8 4EB804D4 lprm69: jsr pdata * print message 412 000BFC 6000FBFA bra lprom * goto prompt 413 000C00 49F81A02 lprm70: lea labtms,a4 * load aborted message 414 000C04 243C00000012 move.l #labtmn-labtms,d2 415 000C0A 60EC bra lprm69 416 * 417 * RSLINK: links to auxiliary RS232 port, allows dow 417+ nloading 418 * 419 000C0C 4EB80490 rslink: jsr outch * echo char 420 000C10 4EB80438 rsloop: jsr inchr2 * get char from aux RS232 421 000C14 6400001A bcc gotch * branch if char available 422 000C18 4EB80408 jsr inchr * get char from terminal 423 000C1C 65F2 bcs rsloop * loop if no char available 424 000C1E B03C001C cmp.b #netbrk,d0 * is it NETWORK BREAK char? 425 000C22 66000006 bne rscont * branch if not 426 000C26 6000FBD0 bra lprom * goto prompt 427 000C2A 4EB804B2 rscont: jsr outch2 * send char to aux RS232 port 428 000C2E 60E0 bra rsloop * loop 429 000C30 B03C0000 gotch: cmp.b #00,d0 * is it null char? 430 000C34 67DA beq rsloop * if so discard and loop 431 000C36 B03C001C cmp.b #netbrk,d0 * is it NETWORK BREAK char? 432 000C3A 6700FF26 beq ploadr * if so, go to program downloader 433 000C3E 4EB80490 jsr outch * otherwise send to terminal 434 000C42 60CC bra rsloop * and loop 435 * 436 * FINDR: finds first location equal to a value 437 * 438 000C44 4EB80490 findr: jsr outch * echo character 439 000C48 4EB80636 jsr sin6hx * get first value Motorola M68000 Assembler Page 21 440 000C4C 6500004C bcs lprm11 * if carry set, goto prompt 441 000C50 2A41 move.l d1,a5 * start address 442 000C52 4EB80636 jsr sin6hx * get second value 443 000C56 65000042 bcs lprm11 * if carry set, goto prompt 444 000C5A 2401 move.l d1,d2 * end address 445 000C5C 948D sub.l a5,d2 * calculate length 446 000C5E 4EB80516 jsr pspac1 * output space 447 000C62 4EB8052A jsr pequal * output "=" 448 000C66 4EB8066A jsr sin2hx * get value 449 000C6A 6500002E bcs lprm11 * if carry set, goto prompt 450 000C6E B01D findlp: cmp.b (a5)+,d0 * scan memory 451 000C70 6700000E beq findif * if equ report 452 000C74 51CAFFF8 fndtst: dbra d2,findlp * decrement and repeat if no 452+ t zero 453 000C78 4EB80534 jsr pokms * print OK message 454 000C7C 6000FB7A bra lprom * goto prompt 455 000C80 4EB804EC findif: jsr newlin * do #cr, lf 456 000C84 538D sub.l #1,a5 * decrement pointer 457 000C86 220D move.l a5,d1 * get different address 458 000C88 4EB80598 jsr sch6hx * print address 459 000C8C 4EB8052A jsr pequal * print "=" 460 000C90 4EB80516 jsr pspac1 * do space 461 000C94 1015 move.b (a5),d0 * get value 462 000C96 4EB805CA jsr ch2hex * print value 463 000C9A 6000FB5C lprm11: bra lprom * goto prompt 464 * 465 * COMPR: compares two blocks of memory; reports if 465+ different 466 * 467 000C9E 4EB80490 compr: jsr outch * echo character 468 000CA2 4EB80636 jsr sin6hx * get first address 469 000CA6 65000068 bcs lprm12 * if carry set, goto prompt 470 000CAA 2841 move.l d1,a4 * start address 471 000CAC 4EB80636 jsr sin6hx * get end address 472 000CB0 6500005E bcs lprm12 * if carry set, goto prompt 473 000CB4 2401 move.l d1,d2 * get end 474 000CB6 948C sub.l a4,d2 * calculate length 475 000CB8 4EB80516 jsr pspac1 * print space 476 000CBC 4EB8052A jsr pequal * print "=" 477 000CC0 4EB80636 jsr sin6hx * get second address 478 000CC4 6500004A bcs lprm12 * if carry set, goto prompt 479 000CC8 2A41 move.l d1,a5 * start address 480 000CCA B90D complp: cmpm.b (a5)+,(a4)+ * compare memory strings 481 000CCC 6600000E bne comdif * if not equ report 482 000CD0 51CAFFF8 cmptst: dbra d2,complp * decrement and repeat if no 482+ t zero 483 000CD4 4EB80534 jsr pokms * print OK message 484 000CD8 6000FB1E bra lprom * goto prompt 485 000CDC 4EB804EC comdif: jsr newlin * do #cr, lf 486 000CE0 538D sub.l #1,a5 * 487 000CE2 538C sub.l #1,a4 * decrement pointers 488 000CE4 220C move.l a4,d1 * get address 489 000CE6 4EB80598 jsr sch6hx * print different address 490 000CEA 4EB8052A jsr pequal * print "=" 491 000CEE 4EB80516 jsr pspac1 * print space 492 000CF2 1014 move.b (a4),d0 * get value 493 000CF4 4EB805AC jsr sch2hx * print value 494 000CF8 4EB804EC jsr newlin * do #cr, lf 495 000CFC 220D move.l a5,d1 * get address Motorola M68000 Assembler Page 22 496 000CFE 4EB80598 jsr sch6hx * print it 497 000D02 4EB8052A jsr pequal * print "=" 498 000D06 4EB80516 jsr pspac1 * print space 499 000D0A 1015 move.b (a5),d0 * get value 500 000D0C 4EB805AC jsr sch2hx * print value 501 000D10 6000FAE6 lprm12: bra lprom * goto prompt 502 * 503 * TSTMEM: memory test routines 504 * 505 000D14 4EB80490 tstmem: jsr outch * echo character 506 000D18 4EB80636 jsr sin6hx * get address 507 000D1C 65000094 bcs lprm42 * if carry set, goto prompt 508 000D20 2C41 move.l d1,a6 * save in A6 register 509 000D22 4EB80516 jsr pspac1 * print space 510 000D26 103C002D move.b #$2d,d0 * 511 000D2A 4EB80490 jsr outch * print "-" 512 000D2E 4EB80636 jsr sin6hx * get end address 513 000D32 6500007E bcs lprm43 * if carry set, goto prompt 514 000D36 2601 move.l d1,d3 * 515 000D38 968E sub.l a6,d3 * calculate length 516 000D3A 4EB80DFA jsr testms * print test message 517 000D3E 103C0031 move.b #$31,d0 * 518 000D42 4EB80490 jsr outch * print '1' 519 000D46 103C00FF move.b #$0ff,d0 * test pattern - all ONES 520 000D4A 4EB80E0A jsr filtst * test memory 521 000D4E 66000066 bne tsterr * if not equ goto report 522 000D52 4EB80534 jsr pokms * print OK message 523 000D56 4EB80DFA jsr testms * print test message 524 000D5A 103C0032 move.b #$32,d0 * 525 000D5E 4EB80490 jsr outch * print '2' 526 000D62 103C0000 move.b #$00,d0 * test pattern - all ZEROS 527 000D66 4EB80E0A jsr filtst * test memory 528 000D6A 6600004A bne tsterr * if not equ goto report 529 000D6E 4EB80534 jsr pokms * print Ok message 530 000D72 4EB80DFA jsr testms * print test message 531 000D76 103C0033 move.b #$33,d0 * 532 000D7A 4EB80490 jsr outch * print '3' 533 000D7E 103C0001 move.b #$01,d0 * initial test pattern 534 000D82 4EB80E0A t3loop: jsr filtst * test memory 535 000D86 6600002E bne tsterr * if not equ goto report 536 000D8A E308 lsl.b #1,d0 * shift pattern 537 000D8C 66F4 bne t3loop * if not zero, repeat loop 538 000D8E 4EB80534 jsr pokms * print OK message 539 000D92 4EB80DFA jsr testms * print test message 540 000D96 103C0034 move.b #$34,d0 * 541 000D9A 4EB80490 jsr outch * print '4' 542 000D9E 103C00FE move.b #$0fe,d0 * initial test pattern 543 000DA2 4EB80E0A t4loop: jsr filtst * test memory 544 000DA6 6600000E bne tsterr * if not equ repeat loop 545 000DAA E318 rol.b #1,d0 * shift pattern 546 000DAC 65F4 bcs t4loop * if carry set, repeat loop 547 000DAE 4EB80534 jsr pokms * jsr OK message 548 000DB2 6000FA44 lprm42: bra lprom * goto prompt 549 00000DB2 lprm43 equ lprm42 550 * 551 * Memory test error reporting routine 552 * 553 000DB6 49F817C6 tsterr: lea errms,a4 * pointer to message 554 000DBA 2F00 move.l d0,-(sp) * save test value Motorola M68000 Assembler Page 23 555 000DBC 243C0000000C move.l #errmn-errms,d2 * length of message 556 000DC2 4EB804D4 jsr pdata * 557 000DC6 220D move.l a5,d1 * get address 558 000DC8 4EB80598 jsr sch6hx * print it 559 000DCC 4EB8052A jsr pequal * print "=" 560 000DD0 4EB80516 jsr pspac1 * print space 561 000DD4 1014 move.b (a4),d0 * get actual value 562 000DD6 4EB805AC jsr sch2hx * print it 563 000DDA 103C003C move.b #$3c,d0 * 564 000DDE 4EB80490 jsr outch * print "<" 565 000DE2 103C003E move.b #$3e,d0 * 566 000DE6 4EB80490 jsr outch * print ">" 567 000DEA 4EB80516 jsr pspac1 * print space 568 000DEE 201F move.l (sp)+,d0 * get test value 569 000DF0 4EB805CA jsr ch2hex * print it 570 000DF4 4EB804EC jsr newlin * print newline 571 000DF8 60B8 bra lprm43 * goto prompt 572 * 573 * TESTMS: print test message 574 * 575 000DFA 49F817D2 testms: lea tstmes,a4 * pointer to message 576 000DFE 243C00000008 move.l #tstmen-tstmes,d2 * length of message 577 000E04 4EB804D4 jsr pdata * print it 578 000E08 4E75 rts * return 579 * 580 * FILTST: fills memory starting at a6, length dx 581 * 582 000E0A 2403 filtst: move.l d3,d2 * block length 583 000E0C 2A4E move.l a6,a5 * block start address 584 000E0E 1AC0 fltst2: move.b d0,(a5)+ * fill byte 585 000E10 51CAFFFC fltst1: dbra d2,fltst2 * loop as rqd 586 000E14 2403 move.l d3,d2 * block length 587 000E16 2A4E move.l a6,a5 * block start address 588 000E18 B01D fltst4: cmp.b (a5)+,d0 * read byte back to check 589 000E1A 66000006 bne flfail * rts with Z unset if fail 590 000E1E 51CAFFF8 fltst3: dbra d2,fltst4 * loop as rqd 591 000E22 4E75 flfail: rts * return 592 * 593 * REGSR: prints values in processor registers 594 * 595 000E24 4EB80490 regsr: jsr outch * echo character, drop through 596 * 597 * REGOUT: prints processor registers 598 * 599 000E28 4EB80E38 jsr regdsp * print D & A registers 600 000E2C 4EB80E70 jsr srpcds * print SR,PC,USP 601 000E30 4EB804EC jsr newlin * cr,lf 602 000E34 6000F9C2 bra lprom * goto prompt 603 * 604 * REGDSP: prints D & A registers from saved registe 604+ r frame 605 * pointed to by A0. A0 unchanged. Uses d0,d2,a4 606 * A6 at end points to saved SR. 607 * 608 000E38 49F818EA regdsp: lea regd1s,a4 * pointer to header msg 609 000E3C 243C00000048 move.l #regd1n-regd1s,d2 * msg length 610 000E42 4EB804D4 jsr pdata * print header msg 611 000E46 2C48 move.l a0,a6 * get pointer to reg. frame to a6 612 000E48 7407 move.l #7,d2 * 8 registers to be printed Motorola M68000 Assembler Page 24 613 000E4A 4EB80E64 jsr stkdsp * print 8 registers from a6 stack 614 000E4E 49F81932 lea regd2s,a4 * pointer to 2nd header msg 615 000E52 243C0000004C move.l #regd2n-regd2s,d2 * msg length 616 000E58 4EB804D4 jsr pdata * print 2nd header 617 000E5C 7407 move.l #7,d2 * 8 registers to be printed 618 000E5E 4EB80E64 jsr stkdsp * print 8 registers, a6 was already cor 618+ rect 619 000E62 4E75 rts 620 * 621 * STKDSP: prints (D2+1) 32 bit values from stack po 621+ inted to 622 * by A6. Uses D0,D1. A6 increased by 4*(D2+1) 623 * 624 000E64 221E stkdsp: move.l (a6)+,d1 * get value 625 000E66 4EB8057C jsr sch8hx * print it with space after 626 000E6A 51CAFFF8 dbra d2,stkdsp * repeat as rqd 627 000E6E 4E75 rts 628 * 629 * SRPCDS: prints SR and PC values from A6 stack, th 629+ en prints USP 630 * value. Uses D0,D2,A4. A6 increased by 6. 631 * 632 000E70 49F8197E srpcds: lea regd3s,a4 * pointer to header msg 633 000E74 243C0000001E move.l #regd3n-regd3s,d2 * msg length 634 000E7A 4EB804D4 jsr pdata * print header msg 635 000E7E 4EB80512 jsr pspac2 * 2 spaces before SR value 636 000E82 321E move.w (a6)+,d1 * get SR value 637 000E84 4EB805A2 jsr sch4hx * print it with space after 638 000E88 4EB80512 jsr pspac2 * 2 extra spaces 639 000E8C 4282 clr.l d2 * zero D2 to print 1 value from a6 stack 640 000E8E 4EB80E64 jsr stkdsp * print value from a6 stack 641 000E92 4E6C move.l usp,a4 * get USP ... 642 000E94 220C move.l a4,d1 * ... to D1 643 000E96 4EB80586 jsr ch8hex * print value from D1 644 000E9A 4E75 rts 645 * 646 * Breakpoint set routine 647 * 648 000E9C 4EB80490 brkpt: jsr outch * echo command char 649 000EA0 4EB80636 jsr sin6hx * print space and get address 650 000EA4 6500F952 bcs lprom * goto prompt if 651 000EA8 4EB805FC jsr chkevn * if odd print msg. and set carry 652 000EAC 6500F94A bcs lprom * if odd goto prompt 653 000EB0 083900000001 btst #0,brkflg * is a breakpoint set? 654 000EB8 67000006 beq nobrk * branch if not 655 000EBC 4EB80F22 jsr unbrk * unset previous breakpoint 656 000EC0 13FC00010001 nobrk: move.b #$01,brkflg * set breakpoint flag 657 000EC8 23C100011024 move.l d1,brkadd * save breakpoint address 658 000ECE 2841 move.l d1,a4 * point to breakpoint addr 659 000ED0 33D400011022 move.w (a4),brksav * save instruction at break add 659+ r 660 000ED6 38BC4E40 move.w #$4e40,(a4) * poke TRAP 0 instruction 661 000EDA 49F8185A lea bsetms,a4 * pointer to message 662 000EDE 243C00000014 move.l #bsetmn-bsetms,d2 * msg length 663 000EE4 4EB804D4 jsr pdata * print message 664 000EE8 4EB805B6 jsr ch6hex * print break addr from D1 665 000EEC 4EB804EC jsr newlin * cr,lf 666 000EF0 6000F906 bra lprom * goto prompt 667 * Motorola M68000 Assembler Page 25 668 * Kill breakpoint routine 669 * 670 000EF4 4EB80490 killbp: jsr outch * echo command char 671 000EF8 083900000001 btst #0,brkflg * is a breakpoint set? 672 000F00 6700000E beq nobrk2 * branch if not 673 000F04 4EB80F22 jsr unbrk * unset the breakpoint 674 000F08 4EB804EC jsr newlin * cr,lf 675 000F0C 6000F8EA bra lprom * goto prompt 676 000F10 49F81886 nobrk2: lea nobkms,a4 * pointer to no breakpoint ms 676+ g 677 000F14 243C00000016 move.l #nobkmn-nobkms,d2 * msg length 678 000F1A 4EB804D4 jsr pdata * print message 679 000F1E 6000F8D8 bra lprom * goto prompt 680 * 681 * UNBRK: Unsets the current breakpoint 682 * 683 000F22 2F01 unbrk: move.l d1,-(sp) * save D1 684 000F24 13FC00000001 move.b #$00,brkflg * unset breakpoint flag 685 000F2C 287900011024 move.l brkadd,a4 * get breakpoint address 686 000F32 38B900011022 move.w brksav,(a4) * restore original instr. word 687 000F38 220C move.l a4,d1 *break addr to D1 688 000F3A 49F8186E lea bkilms,a4 * pointer to break killed msg 689 000F3E 243C00000018 move.l #bkilmn-bkilms,d2 * msg length 690 000F44 4EB804D4 jsr pdata * print message 691 000F48 4EB805B6 jsr ch6hex * print break addr from D1 692 000F4C 221F move.l (sp)+,d1 * restore D1 693 000F4E 4E75 rts 694 * 695 * Set value of saved register routine 696 * 697 000F50 4EB80490 setreg: jsr outch * echo command char 698 000F54 4EB80516 jsr pspac1 * print space 699 000F58 4EB80468 jsr inchu * get upper case char no echo 700 000F5C B03C0041 cmp.b #$41,d0 * is it "A"? 701 000F60 670000FC beq addreg * yes, address register 702 000F64 B03C0044 cmp.b #$44,d0 * is it "D"? 703 000F68 670000B2 beq datreg * yes, data register 704 000F6C B03C0043 cmp.b #$43,d0 * is it "C"? 705 000F70 67000022 beq ccreg * yes, CCR 706 000F74 B03C0050 cmp.b #$50,d0 * is it "P"? 707 000F78 67000056 beq pcreg * yes, PC 708 000F7C B03C0053 cmp.b #$53,d0 * is it "S"? 709 000F80 67000030 beq sreg * yes, SR 710 000F84 B03C0055 cmp.b #$55,d0 * is it "U"? 711 000F88 6700006C beq uspreg * yes, USP 712 000F8C 4EB80520 regerr: jsr pbell * any other char ring bell 713 000F90 6000F866 bra lprom * and goto prompt 714 000F94 49F8189C ccreg: lea ccrms,a4 * pointer to message 715 000F98 243C00000006 move.l #ccrmn-ccrms,d2 * msg length 716 000F9E 4EB804D4 jsr pdata * print message 717 000FA2 4EB8066A jsr sin2hx * print space and get 2 hex chars to D0 718 000FA6 6500F850 bcs lprom * goto prompt if 719 000FAA 11400041 move.b d0,65(a0) * put value in saved CCR on frame 720 000FAE 6000F848 bra lprom 721 000FB2 49F818A2 sreg: lea srms,a4 * pointer to msg 722 000FB6 243C00000004 move.l #srmn-srms,d2 * msg length 723 000FBC 4EB804D4 jsr pdata * print message 724 000FC0 4EB8064E jsr sin4hx * print a space and get 4 digits to d1 725 000FC4 6500F832 bcs lprom * goto prompt if Motorola M68000 Assembler Page 26 726 000FC8 31410040 move.w d1,64(a0) * put in SR in saved registers 727 000FCC 6000F82A bra lprom * goto prompt 728 000FD0 49F818A6 pcreg: lea pcrms,a4 * pointer to msg 729 000FD4 243C00000004 move.l #pcrmn-pcrms,d2 * msg length 730 000FDA 4EB804D4 jsr pdata * print msg 731 000FDE 4EB80622 jsr sin8hx * print space & get 8 hex digits to D1 732 000FE2 6500F814 bcs lprom * goto prompt if 733 000FE6 4EB805FC jsr chkevn * if odd print msg and set carry 734 000FEA 6500F80C bcs lprom * goto prompt if it was odd 735 000FEE 21410042 move.l d1,66(a0) * put in saved PC 736 000FF2 6000F804 bra lprom * goto prompt 737 000FF6 49F818AA uspreg: lea usprms,a4 * pointer to message 738 000FFA 243C00000006 move.l #usprmn-usprms,d2 * length of message 739 001000 4EB804D4 jsr pdata * print "usp =" 740 001004 4EB80622 jsr sin8hx * print space & get 8 hex digits to D1 741 001008 6500F7EE bcs lprom * goto prompt if 742 00100C 4EB805FC jsr chkevn * if odd print msg and set carry 743 001010 6500F7E6 bcs lprom * goto prompt if it was odd 744 001014 2841 move.l d1,a4 * move to ... 745 001016 4E64 move.l a4,usp * ... usp 746 001018 6000F7DE bra lprom * goto prompt 747 00101C 4EB80490 datreg: jsr outch * print the "D" 748 001020 4EB80468 jsr inchu * get upper case char to D0 749 001024 B03C0030 cmp.b #$30,d0 * is it <0? 750 001028 6D00FF62 blt regerr * yes, error 751 00102C B03C0037 cmp.b #$37,d0 * is it >7? 752 001030 6E00FF5A bgt regerr * yes, error 753 001034 1600 move.b d0,d3 * save register no 754 001036 4EB80490 jsr outch * print it 755 00103A 4EB80516 jsr pspac1 * print space 756 00103E 4EB8052A jsr pequal * print "=" 757 001042 C63C000F and.b #$0f,d3 * mask to 4 bits 758 001046 E50B lsl.b #2,d3 * multipy by 4 759 001048 4281 clr.l d1 * clear all D1 760 00104A 1203 move.b d3,d1 * set up index ... 761 00104C 2841 move.l d1,a4 * ... into A4 762 00104E 4EB80622 jsr sin8hx * print space & get 8 hex digits to d1 763 001052 6500F7A4 bcs lprom * prompt if 764 001056 2181C000 move.l d1,0(a0,a4) * move value into saved data re 764+ g 765 00105A 6000F79C bra lprom * goto prompt 766 00105E 4EB80490 addreg: jsr outch * print the "A" 767 001062 4EB80468 jsr inchu * get upper case char to D0 768 001066 B03C0030 cmp.b #$30,d0 * is it <0? 769 00106A 6D00FF20 blt regerr * yes, error 770 00106E B03C0036 cmp.b #$36,d0 * is it >6? (A7 not allowed) 771 001072 6E00FF18 bgt regerr * yes, error 772 001076 1600 move.b d0,d3 * save register no 773 001078 4EB80490 jsr outch * print it 774 00107C 4EB80516 jsr pspac1 * print a space 775 001080 4EB8052A jsr pequal * print "=" 776 001084 C63C000F and.b #$0f,d3 * mask to 4 bits 777 001088 E50B lsl.b #2,d3 * multiply by 4 778 00108A 4281 clr.l d1 * clear all of D1 779 00108C 1203 move.b d3,d1 * set up index ... 780 00108E 2841 move.l d1,a4 * ... into A4 781 001090 4EB80622 jsr sin8hx * print space and get 8 digits to D1 782 001094 6500F762 bcs lprom * goto prompt if 783 001098 2181C020 move.l d1,32(a0,a4) * put into saved address reg Motorola M68000 Assembler Page 27 784 00109C 6000F75A bra lprom * goto prompt 785 * 786 * X trace command routine 787 * 788 0010A0 4EB80490 xtrace: jsr outch * print the command char 789 0010A4 4EB8066A jsr sin2hx * print space & get a 2 digit hex no in 789+ to d0 790 0010A8 6500F74E bcs lprom * goto prompt if 791 0010AC 13C00001101E move.b d0,trccnt * save no of instr. to trace 792 0010B2 4EB804EC xtrac2: jsr newlin * print cr,lf 793 0010B6 006880000040 or.w #$8000,64(a0) * set saved SR to trace mode 794 0010BC 2E48 move.l a0,sp * sp to point at saved reg frame 795 0010BE 4CDFFFFF movem.l (sp)+,d0-d7/a0-a6/sp * restore saved regis 795+ ter frame 796 0010C2 4E73 rte 797 * 798 * Z trace (single step) command 799 * 800 0010C4 4EB80490 ztrace: jsr outch * print the command char 801 0010C8 13FC00010001 move.b #1,trccnt * 1 instruction only 802 0010D0 60E0 bra xtrac2 * goto trace routine 803 * 804 * STOP LOOP - entered if trace command done without 804+ setting PC 805 * 806 0010D2 60FE stoplp: bra stoplp 807 * 808 * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 808+ *:*:*:*:*:*:* 809 * 810 * EXCEPTION HANDLING ROUTINES 811 * 812 * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 812+ *:*:*:*:*:*:* 813 * 814 * Address error and Bus error exception handler 815 * 816 0010D4 48E7FFFF berr: movem.l d0-d7/a0-a6/sp,-(sp) * save registers 817 000010D4 adderr equ berr 818 0010D8 204F move.l sp,a0 * get saved register frame pointer 819 0010DA 49F8199C lea berrms,a4 * pointer to error message 820 0010DE 243C0000001C move.l #berrmn-berrms,d2 * msg length 821 0010E4 4EB804D4 jsr pdata * print message 822 0010E8 4EB80E38 jsr regdsp * print data and address registers 823 0010EC 49F819B8 lea errhds,a4 * pointer to error header msg 824 0010F0 243C0000001E move.l #errhdn-errhds,d2 * msg length 825 0010F6 4EB804D4 jsr pdata * print msg 826 0010FA 4EB80512 jsr pspac2 * two spaces 827 0010FE 321E move.w (a6)+,d1 * get 1st debug word from stack 828 001100 4EB805A2 jsr sch4hx * print space and word 829 001104 4EB80512 jsr pspac2 * 2 spaces 830 001108 221E move.l (a6)+,d1 * get next 2 debug words 831 00110A 4EB8057C jsr sch8hx * space and print words 832 00110E 4EB80512 jsr pspac2 * two spaces 833 001112 321E move.w (a6)+,d1 * get last debug word 834 001114 4EB805A2 jsr sch4hx * space and print it 835 001118 4EB80E70 jsr srpcds * print saved SR,PC and USP 836 00111C 4EB804EC jsr newlin * cr,lf 837 001120 40E80040 move.w sr,64(a0) * put SR into posn in saved regs Motorola M68000 Assembler Page 28 838 001124 4DF810D2 lea stoplp,a6 * saved PC will point to stop loop 839 001128 214E0042 move.l a6,66(a0) * put into saved PC 840 * 841 * The last 3 instructions are needed because these 841+ two exceptions 842 * store extra things on the stack which must be rep 842+ laced with a 843 * reasonable SR and PC before a G,X, or Z command i 843+ s done 844 * 845 00112C 6000F6CA bra lprom * goto prompt 846 * 847 * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 847+ *:*:*:*:*:*:* 848 * 849 * Error exception ( nos 4-8,10,11 ) handler routine 850 * 851 * This is entered via a set of jumps in RAM which a 851+ lso store 852 * the exception no in D2/0 853 * 854 001130 48E7FFFF excep: movem.l d0-d7/a0-a6/sp,-(sp) * save register 854+ s 855 001134 204F move.l sp,a0 * set a0 to point at saved reg frame 856 001136 49F818BE lea exceps,a4 * pointer to exception message 857 00113A 243C0000002C move.l #excepn-exceps,d2 * msg length 858 001140 4EB804D4 jsr pdata * print msg 859 001144 4EB80E38 jsr regdsp * print data and addr regs 860 001148 4EB80E70 jsr srpcds * print saved SR,PC, & USP 861 00114C 4EB804EC jsr newlin * cr,lf 862 001150 6000F6A6 bra lprom * goto prompt 863 * 864 * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 864+ *:*:*:*:*:*:* 865 * 866 * Trace exception handler routine 867 * 868 001154 48E7FFFF trace: movem.l d0-d7/a0-a6/sp,-(sp) * save register 868+ s 869 001158 204F move.l sp,a0 * set a0 to point at saved reg frame 870 00115A 4EB80E38 jsr regdsp * print data and addr registers 871 00115E 4EB80E70 jsr srpcds * print saved SR,PC,and USP 872 001162 4EB804EC jsr newlin * cr,lf 873 001166 4EB80408 jsr inchr * has a character come in? 874 00116A 6500000E bcs nochar * branch if not 875 00116E B03C0020 cmp.b #space,d0 * is it a space? 876 001172 66000006 bne nochar * branch if not 877 001176 6700F680 beq lprom * stop trace and goto prompt if space 878 00117A 53390001101E nochar: sub.b #1,trccnt * decrement trace instr. co 878+ unt 879 001180 6700F676 beq lprom * goto prompt if done 880 001184 2E48 move.l a0,sp * restore sp to saved reg frame 881 001186 4CDFFFFF movem.l (sp)+,d0-d7/a0-a6/sp * restore registers 882 00118A 4E73 rte * go 883 * 884 * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 884+ *:*:*:*:*:*:* 885 * 886 * Breakpoint (TRAP 0) handler routine Motorola M68000 Assembler Page 29 887 * 888 00118C 48E7FFFF trap0: movem.l d0-d7/a0-a6/sp,-(sp) * save register 888+ s 889 001190 204F move.l sp,a0 * set a0 to point to saved reg frame 890 001192 55A80042 sub.l #2,66(a0) * back up saved PC by 2 to point a 890+ t TRAP instr. 891 001196 49F818B0 lea brkmss,a4 * pointer to breakpoint message 892 00119A 243C0000000E move.l #brkmsn-brkmss,d2 * length of message 893 0011A0 4EB804D4 jsr pdata * print msg 894 0011A4 4EB80E38 jsr regdsp * print data and addr registers 895 0011A8 4EB80E70 jsr srpcds * print saved SR,PC and USP 896 0011AC 4EB804EC jsr newlin * cr,lf 897 0011B0 6000F646 bra lprom * goto prompt 898 * 899 * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 899+ *:*:*:*:*:*:* 900 * 901 * TRAP 1 (inch4) and TRAP 2 (outch4) handlers to in 901+ put a char 902 * with echo, and to output a char, via serial link 903 * 904 0011B4 4EB80430 inch4: jsr inch * get character 905 0011B8 4EB80490 outch4: jsr outch * echo it 906 0011BC 4E73 rte * return from interrupt 907 * 908 * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 908+ *:*:*:*:*:*:* 909 * 910 * Initialisation routines 911 * 912 * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 912+ *:*:*:*:*:*:* 913 * 914 * 915 * 68681 initialization : 9600 baud,7 data bits, spa 915+ ce parity,1 stop bit, 916 * no parity check 917 * 918 0011BE 48E7C0C0 inits: movem.l d0/d1/a0/a1,-(a7) * save registers 919 0011C2 207C00001214 move.l #table,a0 * get init parameters 920 0011C8 203C00000015 move.l #length,d0 * get number of parameters 921 * 922 0011CE 60000008 bra sk0init * do loop test 923 0011D2 2258 lp0init: move.l (a0)+,a1 * get register address 924 0011D4 2218 move.l (a0)+,d1 * parity etc. 925 * 926 0011D6 1281 move.b d1,(a1) * put command 927 0011D8 51C8FFF8 sk0init: dbra d0,lp0init * loop test 928 * 929 0011DC 13FC00000002 move.b #noints,imr * clear all interrupt enables 930 * 931 * 932 0011E4 207C00070000 move.l #$70000,a0 * get led/gen purpos 932+ e register address 933 0011EA 30BCFFFE move.w #$fffe,(a0) * put green led on o 933+ nly. 934 * 935 0011EE 13FC00040002 move.b #ten,cmda 936 0011F6 13FC00040002 move.b #ten,cmdb Motorola M68000 Assembler Page 30 937 0011FE 13FC00010002 move.b #ren,cmda 938 001206 13FC00010002 move.b #ren,cmdb 939 00120E 4CDF0303 movem.l (a7)+,d0/d1/a0/a1_*restore registers 940 001212 4E75 rts 941 * 942 * set mode of channel A - 7 bits, no parity, 1 stop 942+ bit 9600 baud 943 * no hsking 944 * 945 001214 0002000B table:dc.l imr,noints 946 00121C 00020005 dc.l cmda,point1 947 001224 00020001 dc.l modea,norrts+rirdy+cerr+nopar+bits8 948 00122C 00020001 dc.l modea,norop+notrts+nocts+stop1 949 * 950 * Set mode of Channel B - 7 bits, no parity, 1 stop 950+ bit, 9600 baud 951 * no hsking 952 * 953 001234 00020015 dc.l cmdb,point1 954 00123C 00020011 dc.l modeb,norrts+rirdy+cerr+nopar+bits8 955 001244 00020011 dc.l modeb,norop+notrts+nocts+stop1 956 * 957 * set output port config register 958 * 959 00124C 0002001B dc.l opcr,allout 960 * 961 * Reset and enable channel A 962 * 963 001254 00020005 dc.l cmda,rstrx 964 00125C 00020005 dc.l cmda,rsttx_* reset transmitter 965 001264 00020005 dc.l cmda,rsterr 966 00126C 00020005 dc.l cmda,rstint 967 001274 00020005 dc.l cmda,brkoff+tdis+ren 968 00127C 00020003 dc.l clka,b9600 969 * 970 * Reset and enable channel b 971 * 972 001284 00020015 dc.l cmdb,rstrx 973 00128C 00020015 dc.l cmdb,rsttx 974 001294 00020015 dc.l cmdb,rsterr 975 00129C 00020015 dc.l cmdb,rstint 976 0012A4 00020015 dc.l cmdb,brkoff+tdis+ren 977 0012AC 00020013 dc.l clkb,b9600 978 * 979 * Setup output pins 980 * 981 0012B4 0002001D dc.l bitset,$ff 982 00000015 length equ (*-table)/8 983 0012BC 4E75 rts 984 * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 984+ *:*:*:*:*:*:* 985 * 986 * Now we have messages and vector table file 987 * 988 incl msgoct90.asm 1& * 2& * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 2+ *:*:*:*:*:*:* 3& * Motorola M68000 Assembler Page 31 4& * Program messages 5& * 6& 0012BE 0D intros: dc.b cr,lf,lf,'The POSIE Distributed System 6+ 0012BF 0A Monitor Board' 7& 0012EB 0D dc.b cr,lf,'Interpretation Processor Monitor 7+ 0012EC 0A ' 8& 00130D 0D dc.b cr,lf,'Version 1.1, October 1990' 9& 001328 0D dc.b cr,lf,lf,'Type ? for help',cr,lf 10& 00133C 00000000 intron: ds.w 0 * align 11& 00133C 0D promms: dc.b cr,lf,'PDSMBip>' 12& 001346 00000000 prommn: ds.w 0 13& 001346 0D helpms: dc.b cr,lf,lf,'A Hex 13+ 001347 0A adecimal Arithmetic' 14& 001378 0D dc.b cr,lf,'B Set breakpoin 14+ 001379 0A t at ' 15& 0013AB 0D dc.b cr,lf,'C -> Copy block of 15+ 0013AC 0A memory' 16& 0013DA 0D dc.b cr,lf,'D Display a blo 16+ 0013DB 0A ck of memory' 17& 00140E 0D dc.b cr,lf,'F = Fills memory 17+ 00140F 0A with ' 18& 001442 0D dc.b cr,lf,'G Start program 18+ 001443 0A ' 19& 00146A 0D dc.b cr,lf,'H Convert hex t 19+ 00146B 0A o decimal' 20& 00149B 0D dc.b cr,lf,'I = Find location 20+ 00149C 0A not equal ' 21& 0014D5 0D dc.b cr,lf,'J = Find location 21+ 0014D6 0A equal to ' 22& 00150E 0D dc.b cr,lf,'K Kills breakpo 22+ 00150F 0A int' 23& 001539 0D dc.b cr,lf,'L * Link to remot 23+ 00153A 0A e device' 24& 001569 0D dc.b cr,lf,'M Modify memory 24+ 00156A 0A ' 25& 001591 0D dc.b cr,lf,'P Link to auxil 25+ 001592 0A iary RS232 port' 26& 0015C8 0D dc.b cr,lf,'Q * Disconnect fr 26+ 0015C9 0A om network' 27& 0015FA 0D dc.b cr,lf,'R Prints proces 27+ 0015FB 0A sor registers' 28& 00162F 0D dc.b cr,lf,'S * Set up connec 28+ 001630 0A tion to ' 29& 001669 0D dc.b cr,lf,'T - Test memory - 29+ 00166A 0A DESTROYS CONTENTS' 30& 0016A3 0D dc.b cr,lf,'U = Updates saved 30+ 0016A4 0A register' 31& 0016D4 0D dc.b cr,lf,'V = Compare two b 31+ 0016D5 0A locks of memory' 32& 00170B 0D dc.b cr,lf,'W * Display netwo 32+ 00170C 0A rk connection' 33& 001740 0D dc.b cr,lf,'X (00-FF) Trace instrs to halt' 34& 001785 0D dc.b cr,lf,'Z Run one instr 34+ 001786 0A uction' 35& 0017B4 00000000 helpmn: ds.w 0 36& 0017B4 20 arrms: dc.b ' ->' 37& 0017B8 00000000 arrmn: ds.w 0 38& 0017B8 20 wrerms: dc.b ' - Write ERROR' Motorola M68000 Assembler Page 32 39& 0017C6 00000000 wrermn: ds.w 0 40& 0017C6 20 errms: dc.b ' - ERROR',bell,cr,lf 41& 0017D2 00000000 errmn: ds.w 0 42& 0017D2 0D tstmes: dc.b cr,lf,'TEST #' 43& 0017DA 00000000 tstmen: ds.w 0 44& 0017DA 0D rmcons: dc.b cr,lf,'Connected to ' 45& 0017EA 00000000 rmconn: ds.w 0 46& 0017EA 0D cants: dc.b cr,lf,'Cant connect to ',bell 47& 0017FE 00000000 cantn: ds.w 0 48& 0017FE 0D cantds: dc.b cr,lf,'Cant disconnect from ',bell 49& 001816 00000000 cantdn: ds.w 0 50& 001816 0D cnbrks: dc.b cr,lf,'Connection broken',bell 51& 00182A 00000000 cnbrkn: ds.w 0 52& 00182A 0D discs: dc.b cr,lf,'Disconnect from ' 53& 00183C 00000000 discn: ds.w 0 54& 00183C 0D nocons: dc.b cr,lf,'No network connection set up' 55& 00185A 00000000 noconn: ds.w 0 56& 00185A 0D bsetms: dc.b cr,lf,'Breakpoint set at ' 57& 00186E 00000000 bsetmn: ds.w 0 58& 00186E 0D bkilms: dc.b cr,lf,'Breakpoint cleared at ' 59& 001886 00000000 bkilmn: ds.w 0 60& 001886 0D nobkms: dc.b cr,lf,'No breakpoint set',cr,lf,bell 61& 00189C 00000000 nobkmn: ds.w 0 62& 00189C 43 ccrms: dc.b 'CCR =' 63& 0018A2 00000000 ccrmn: ds.w 0 64& 0018A2 53 srms: dc.b 'SR =' 65& 0018A6 00000000 srmn: ds.w 0 66& 0018A6 50 pcrms: dc.b 'PC =' 67& 0018AA 00000000 pcrmn: ds.w 0 68& 0018AA 55 usprms: dc.b 'USP =' 69& 0018B0 00000000 usprmn: ds.w 0 70& 0018B0 0D brkmss: dc.b cr,lf,'Break - ',cr,lf,bell 71& 0018BE 00000000 brkmsn: ds.w 0 72& 0018BE 0D exceps: dc.b cr,lf,'Exception - D7/0 holds exceptio 72+ 0018BF 0A n number',cr,lf,bell 73& 0018EA 00000000 excepn: ds.w 0 74& 0018EA 0D regd1s: dc.b cr,lf,' D0 D1 D2 D 74+ 0018EB 0A 3 D4 D5 D6 D7',cr,lf 75& 001932 00000000 regd1n: ds.w 0 76& 001932 0D regd2s: dc.b cr,lf,lf,' A0 A1 A2 76+ 001933 0A A3 A4 A5 A6 A7/SSP',cr,lf 77& 00197E 00000000 regd2n: ds.w 0 78& 00197E 0D regd3s: dc.b cr,lf,lf,' SR PC USP',cr 78+ 00197F 0A ,lf 79& 00199C 00000000 regd3n: ds.w 0 80& 00199C 0D berrms: dc.b cr,lf,'Address or bus error -',cr,lf,b 80+ 00199D 0A ell 81& 0019B8 00000000 berrmn: ds.w 0 82& 0019B8 0D errhds: dc.b cr,lf,lf,'cyc.type err.addr instr.',c 82+ 0019B9 0A r,lf 83& 0019D6 00000000 errhdn: ds.w 0 84& 0019D6 0D oddms: dc.b cr,lf,'Address must be even',cr,lf,bell 85& 0019F0 00000000 oddmn: ds.w 0 86& 0019F0 0D lfinms: dc.b cr,lf,'Load finished',cr,lf 87& 001A02 00000000 lfinmn: ds.w 0 88& 001A02 0D labtms: dc.b cr,lf,'Load aborted',cr,lf,bell 89& 001A14 00000000 labtmn: ds.w 0 90& * 91& * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: Motorola M68000 Assembler Page 33 91+ *:*:*:*:*:*:* 92& * 93& * Exception vector table 94& * 95& 0001FE00 vec4 equ ramtop-vecsize+1 * position of RAM jump ta 95+ ble 96& * 97& 00000000 org $000000 98& * 99& 000000 0001FDFE exvecs: dc.l stack * initial stack pointer 100& 000004 000007C4 dc.l main * reset entry vector 101& 000008 000010D4 dc.l berr * bus error 102& 00000C 000010D4 dc.l adderr * address error 103& 000010 0001FE00 dc.l vec4 * jump to 8 bytes of RAM instructions 104& 000014 0001FE08 dc.l vec4+8 105& 000018 0001FE10 dc.l vec4+16 106& 00001C 0001FE18 dc.l vec4+24 107& 000020 0001FE20 dc.l vec4+32 108& 000024 00001154 dc.l trace * trace handler entry 109& 000028 0001FE28 dc.l vec4+40 110& 00002C 0001FE30 dc.l vec4+48 111& 000030 00000030 ds.l 12 * no vectors for Motorola reserved exceps 112& 000060 0001FE38 dc.l vec4+56 * spurious interrupt 113& 000064 0001FE40 dc.l vec4+64 * autovector 1 - 4 bytes in RAM alloc 113+ ated 114& 000068 0001FE48 dc.l vec4+72 * 2 from now on 115& 00006C 0001FE50 dc.l vec4+80 * 3 116& 000070 0001FE58 dc.l vec4+88 * 4 117& 000074 0001FE60 dc.l vec4+96 * 5 118& 000078 0001FE68 dc.l vec4+104 * 6 119& 00007C 0001FE70 dc.l vec4+112 * 7 120& 000080 0000118C dc.l trap0 * breakpoint 121& 000084 000011B4 dc.l inch4 * char I/P 122& 000088 000011B8 dc.l outch4 * char O/P 123& 00008C 0001FE78 dc.l vec4+120 * traps 3 to 15 124& 000090 0001FE7C dc.l vec4+96+28 125& 000094 0001FE80 dc.l vec4+100+28 126& 000098 0001FE84 dc.l vec4+104+28 127& 00009C 0001FE88 dc.l vec4+108+28 128& 0000A0 0001FE8C dc.l vec4+112+28 129& 0000A4 0001FE90 dc.l vec4+116+28 130& 0000A8 0001FE94 dc.l vec4+120+28 131& 0000AC 0001FE98 dc.l vec4+124+28 132& 0000B0 0001FE9C dc.l vec4+128+28 133& 0000B4 0001FEA0 dc.l vec4+132+28 134& 0000B8 0001FEA4 dc.l vec4+136+28 135& 0000BC 0001FEA8 dc.l vec4+140+28 136& 0000C0 00000040 ds.l 16 * more reserved vectors 137& 000100 0001FEAC dc.l vec4+144+28 * interrupt vectors 64-79 138& 000104 0001FEB0 dc.l vec4+148+28 139& 000108 0001FEB4 dc.l vec4+152+28 140& 00010C 0001FEB8 dc.l vec4+156+28 141& 000110 0001FEBC dc.l vec4+160+28 142& 000114 0001FEC0 dc.l vec4+164+28 143& 000118 0001FEC4 dc.l vec4+168+28 144& 00011C 0001FEC8 dc.l vec4+172+28 145& 000120 0001FECC dc.l vec4+176+28 146& 000124 0001FED0 dc.l vec4+180+28 147& 000128 0001FED4 dc.l vec4+184+28 Motorola M68000 Assembler Page 34 148& 00012C 0001FED8 dc.l vec4+188+28 149& 000130 0001FEDC dc.l vec4+192+28 150& 000134 0001FEE0 dc.l vec4+196+28 151& 000138 0001FEE4 dc.l vec4+200+28 152& 00013C 0001FEE8 dc.l vec4+204+28 153& * 154& * 155& end 989 * 990 * 991 * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*: 991+ *:*:*:*:*:*:* 992 * 993 end No faults and no warnings in this assembly.