diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2025-03-23 14:29:59 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2025-03-23 14:29:59 -0400 |
| commit | 86689479fb5f7901a0f99ecdb7357f54f552e33e (patch) | |
| tree | 150c1dd705fa768125675e7491a3a3efb41c97db | |
| parent | 25ab91d11ec8357508685094f8cd79c52c9ad7de (diff) | |
HW 8: Seems to be working fully
| -rw-r--r-- | cmpen472_hw8McDonnell/ASM_layout.hwl | 10 | ||||
| -rw-r--r-- | cmpen472_hw8McDonnell/Full_Chip_Simulation.ini | 2 | ||||
| -rw-r--r-- | cmpen472_hw8McDonnell/Sources/main.asm | 60 | ||||
| -rw-r--r-- | cmpen472_hw8McDonnell/bin/Project.abs | bin | 7816 -> 7968 bytes | |||
| -rw-r--r-- | cmpen472_hw8McDonnell/bin/Project.abs.phy | 2 | ||||
| -rw-r--r-- | cmpen472_hw8McDonnell/bin/Project.abs.s19 | 73 | ||||
| -rw-r--r-- | cmpen472_hw8McDonnell/bin/main.dbg | 60 | ||||
| -rw-r--r-- | cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/ObjectCode/main.asm.o | bin | 7816 -> 7968 bytes | |||
| -rw-r--r-- | cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/ObjectCode/main.asm.sx | 73 | ||||
| -rw-r--r-- | cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/TargetDataWindows.tdt | bin | 64988 -> 65029 bytes |
10 files changed, 174 insertions, 106 deletions
diff --git a/cmpen472_hw8McDonnell/ASM_layout.hwl b/cmpen472_hw8McDonnell/ASM_layout.hwl index 0eb91ba..22795c3 100644 --- a/cmpen472_hw8McDonnell/ASM_layout.hwl +++ b/cmpen472_hw8McDonnell/ASM_layout.hwl @@ -12,10 +12,16 @@ OPEN data 0 42 60 28 Data < attributes SCOPE global,COMPLEMENT None,FORMAT Symb,MODE automatic,SORT NotSort,UPDATERATE 10,NAMEWIDTH 16 OPEN command 0 70 60 30 Command < attributes CACHESIZE 1000 -OPEN Terminal 10 20 85 69 +OPEN Terminal 10 20 40 69 Terminal < attributes CACHESIZE 1000 Terminal < attributes SCI_DEFAULT_TEXT "Virtual SCI",SCI_CONNECTION 0,1,SCI_CONNECTION 1,0,SCI_CONNECTION 1,3,SCI_CONNECTION 3,1,SCI_PORT COM1,SCI_BAUD 9600,SCI_SHOW_PROTOCOL OFF,SCI_VIRTUAL_IN "Sci:2.SerialOutput",SCI_VIRTUAL_OUT "Sci:2.SerialInput",SCI_FILENAME_IN "",SCI_FILENAME_OUT "" +OPEN Visualizationtool 76 37 11 29 +VisualizationTool< Attributes [stEditM="0",swRefresh="3",refCycles="1"] +VisualizationTool< LoadInstrument Seg7[BoundX="26",BoundY="12",Port="0x1",swDM="2"] +VisualizationTool< LoadInstrument Seg7[BoundX="67",BoundY="14",Port="0x1",swDM="1"] +VisualizationTool< LoadInstrument DILSwitch[BoundX="25",BoundY="106",Port="0x1"] +VisualizationTool< ResetVT Undo bckcolor 50331647 font 'Courier New' 9 BLACK AUTOSIZE on -ACTIVATE "Assembly" "Memory" "Register" "Command" "Data" "Source" "Procedure" "Terminal" +ACTIVATE "Assembly" "Memory" "Register" "Command" "Data" "Source" "Procedure" "Terminal" "VisualizationTool" diff --git a/cmpen472_hw8McDonnell/Full_Chip_Simulation.ini b/cmpen472_hw8McDonnell/Full_Chip_Simulation.ini index eb3f16f..b56906d 100644 --- a/cmpen472_hw8McDonnell/Full_Chip_Simulation.ini +++ b/cmpen472_hw8McDonnell/Full_Chip_Simulation.ini @@ -10,7 +10,7 @@ Target=sim Layout=ASM_layout.hwl LoadDialogOptions=AUTOERASEANDFLASH NORUNAFTERLOAD CPU=HC12 -MainFrame=0,1,-1,-1,-1,-1,90,205,2010,1221 +MainFrame=0,1,-1,-1,-1,-1,854,150,1955,1166 Configuration=Full_Chip_Simulation.hwc Statusbar=1 ShowToolbar=1 diff --git a/cmpen472_hw8McDonnell/Sources/main.asm b/cmpen472_hw8McDonnell/Sources/main.asm index 51d8820..903738f 100644 --- a/cmpen472_hw8McDonnell/Sources/main.asm +++ b/cmpen472_hw8McDonnell/Sources/main.asm @@ -99,9 +99,9 @@ outputBuf dc.b 'h' ; Used to control what to output on 7 se * * There is a section Data Section at the end of the file ************************************************************************** -* Interrupt Vector Section: address used [ $FFF0 to $FFFF ] RAM Memory +* RTI Vector Section: address used [ $FFF0 to $FFF1 ] RAM Memory * - org $FFF0 ; Memory location for Interrupt vector section for simulator + org $FFF0 ; Memory location for RTI interrupt vector section for simulator dc.w rtiisr ; Real Time Interrupt vector * ************************************************************************** @@ -127,6 +127,9 @@ pgstart lds #$3100 ; initialize the stack pointer bset CRGINT,%10000000; enable RTI interrupt bset CRGFLG,%10000000; clear RTI IF (Interrupt Flag) + ldaa #$FF ; Two 7 segment displays on PORTB + staa DDRB ; Set all of PORTB as output + ldx #inputBuffer ; Load the address of inputBuffer into X ldy lenInput ; Load the length of inputBuffer into Y jsr Zeros ; Zero out inputBuffer @@ -158,6 +161,7 @@ TypeWrite twLoop jsr getchar ; Read a character from the serial console tsta ; Compare A to 0 beq twLoop ; If A == 0, branch to twLoop + staa PORTB ; Write A to PORTB jsr putchar ; Write character to serial console bra twLoop ; Branch always to twLoop @@ -166,12 +170,11 @@ twLoop jsr getchar ; Read a character from the serial conso * rtiisr bset CRGFLG,%10000000; Clear RTI Interrupt Flag - pshx ; Save X to the stack ldx counter ; Load counter into X inx ; Increment counter by 1 stx counter ; Save X to counter - cpx #9000 ; Compare counter to 9000, This is about 1 second on my computer - bne rtiSkip ; If counter != 400, branch to rtiSkip + cpx #200 ; Compare counter to 200, This is about 1 second on my computer + bne rtiSkip ; If counter != 200, branch to rtiSkip ldx #0 ; Load 0 into X stx counter ; Save X to counter ldx seconds ; Load the seconds into X @@ -196,8 +199,7 @@ rtiisr bset CRGFLG,%10000000; Clear RTI Interrupt Flag ldx #0 ; Reset the hours stx hours ; Save the updated hours rtidone jsr PrintTime ; Jump to PrintTime -rtiSkip pulx ; Restore X from the stack - RTI +rtiSkip RTI ; Return from RTI ISR PrintTime pshd ; Save D to the stack @@ -249,11 +251,40 @@ goodSecs ldy #buffer ; Load the address of buffer into Y jsr WriteString ; Write the string to the serial ldx #inputBuffer ; Load the address of the inputBuffer into X jsr WriteString ; Write the string to the serial + ldaa outputBuf ; Load outputBuf into A + cmpa #'h' ; Compare A to 'h' + bne pTimeIsM ; If A != 'h', branch to pTimeIsM + ldd hours ; Load hours into B + bra skipRest ; Jump to skipRest +pTimeIsM cmpa #'m' ; Compare A to 'm' + bne pTimeIsS ; If A != 'm', branch to pTimeIsS + ldd minutes ; Load Minutes into D + bra skipRest ; Jump to skipRest +pTimeIsS ldd seconds ; Load seconds into D +skipRest jsr TimeOnPortB ; Call TimeOnPortB to output time pulx ; Restore X from the stack puly ; Restore Y from the stack puld ; Restore D from the stack rts ; Return to caller +TimeOnPortB + pshd ; Save D to the stack + pshx ; Save X to the stack + ldx #10 ; Load 10 into X to get digit + idiv ; Divide D by X and save Digit into D + pshb ; Save B to the stack (Lower Byte of D) + exg x,d ; Swap X and D + ldx #10 ; Load 10 into X to get digit + lslb ; Shift B left by 1 + lslb ; Shift B left by 1 + lslb ; Shift B left by 1 + lslb ; Shift B left by 1 + orab 1,sp+ ; Or B with Digit on stack + stab PORTB ; Save B to PORTB + pulx ; Restore X from the stack + puld ; Restore D from the stack + rts ; Return from caller + ExecuteCommand pshd ; Save D to the stack pshy ; Save Y to the stack @@ -326,6 +357,11 @@ isQ cmpa #'q' ; Compare A to 'q' jmp TypeWrite ; Jump to TypeWrite badCommand cli ; Reenable interrupts pshx ; Save X to the stack + ldaa #' ' ; Load Space character into A + jsr putchar ; Jump to putchar to write space character + jsr putchar ; Jump to putchar to write space character + jsr putchar ; Jump to putchar to write space character + jsr putchar ; Jump to putchar to write space character ldx #error ; Load the address of the error prompt into X jsr WriteString ; Jump to WriteString ldx #badInput ; Load the address of badInput into X @@ -583,9 +619,7 @@ readLoop jsr getchar ; Jump to putchar to write byte to seria dey ; Decrement Y by 1 beq doneRead ; If Y == 0, no more room, stop reading bra readLoop ; branch always to readLoop -doneRead ldaa #LF ; Load Line Feed into A - jsr putchar ; Write LF to terminal - pulx ; Restore X from the stack +doneRead pulx ; Restore X from the stack pulY ; Restore Y from the stack pula ; restore A from the stack rts ; return to caller @@ -627,17 +661,13 @@ getchar7 clra ; Set A to 0 * Data Section 2: address used [ $3100 to $3FFF ] RAM Memory * -invalidStr dc.b 'Invalid Input',CR,LF,NULL ; Invalid input error message - clock dc.b 'Clock> ',NULL ; Prompt string for clock CMD dc.b 'CMD> ',NULL ; Prompt string for CMD error dc.b 'Error> ',NULL ; Prompt string for errors -badInput dc.b 'Invalid Input',CR,LF,NULL ; Invalid Input Prompt - -overflow dc.b 'Overflow Error',CR,LF,NULL ; Overflow error message +badInput dc.b 'Invalid Input',NULL ; Invalid Input Prompt ; twMsg: welcome message for typewrite twMsg dc.b 'Clock stopped and Typewrite program started.',CR,LF diff --git a/cmpen472_hw8McDonnell/bin/Project.abs b/cmpen472_hw8McDonnell/bin/Project.abs Binary files differindex 6a529c1..0d33129 100644 --- a/cmpen472_hw8McDonnell/bin/Project.abs +++ b/cmpen472_hw8McDonnell/bin/Project.abs diff --git a/cmpen472_hw8McDonnell/bin/Project.abs.phy b/cmpen472_hw8McDonnell/bin/Project.abs.phy index 92542b2..05d1923 100644 --- a/cmpen472_hw8McDonnell/bin/Project.abs.phy +++ b/cmpen472_hw8McDonnell/bin/Project.abs.phy @@ -1,3 +1,3 @@ S0580000433A5C55736572735C4A61636F62204D63446F6E6E656C6C5C446F63756D656E74735C434D50454E2D3437322D48575C636D70656E3437325F6877384D63446F6E6E656C6C5C62696E5C50726F6A6563742E61627348 -S2060FFFF0316466 +S2060FFFF0316A60 S9030000FC diff --git a/cmpen472_hw8McDonnell/bin/Project.abs.s19 b/cmpen472_hw8McDonnell/bin/Project.abs.s19 index 357dfe4..b97742f 100644 --- a/cmpen472_hw8McDonnell/bin/Project.abs.s19 +++ b/cmpen472_hw8McDonnell/bin/Project.abs.s19 @@ -2,40 +2,41 @@ S0580000433A5C55736572735C4A61636F62204D63446F6E6E656C6C5C446F63756D656E74735C43 S123300000000000000000000000000000000000000010000000000000000000000000009C S123302000000000001000000000000000000000000000000000000000000000000000007C S106304000106811 -S1233100CF310086F15A03860C5ACBCC00015CC8CE34731633AD4C3B194C38804C3780CE4F -S12331203030FD304016339E10EF1631B5CE3030FD30401633B9CE303016322FCE3030FD6F -S1233140304016339E14101631B510EF20DF14104D3880CE342F1633AD1633DF9727FA16B0 -S123316033D820F54C378034FE302C087E302C8E2328263FCE00007E302CFE302A087E30C4 -S12331802A8E003C262ACE00007E302AFE3028087E30288E003C2618CE00007E3028FE3033 -S12331A026087E30268E00182606CE00007E30261631B5300B3B3534860D1633D8860A1660 -S12331C033D8CE33F81633ADFC30268C000A24073686301633D832CD300016332F863A1654 -S12331E033D8FC30288C000A24073686301633D832CD300016332F863A1633D8FC302A8C34 -S1233200000A24073686301633D832CD300016332F86201633D81633D81633D81633D8CEC9 -S123322034001633ADCE30301633AD30313A3D3B35A630182700A281742654A62081202740 -S1233240FA14101632DCB7E48C0018247C8C00002D777C3026A61F813A266E1632DCB7E474 -S12332608C003C24648C00002D5F7C3028A61F813A26561632DCB7E48C003C244C8C00008F -S12332802D477C302AA61F8100263E10EF204A8168260BE630C10026307A3042203B816D51 -S12332A0260BE630C10026217A3042202C8173260BE630C10026127A3042201D8171260905 -S12332C0E630C100260306314E10EF34CE34061633ADCE340E1633AD30313A3D3BCD00004E -S12332E0E630272EC12B272AC12D2726C12A2722C12F271EC13A271AC1202716C1302D17EF -S1233300C1392213C03037CC000A13B7C63319ED20CE87B7023A3D8604B7023A3D343536B6 -S1233320A67F27056A3020F8876A303231303D34353B8C0000274C2D533635348630CE301F -S123334013CD00051633A73031876A4032CE000A18108E00002708CB306B60B7D420EE8C28 -S1233360000026F3B6302F812D26026A60CE301316331D1633ADFD3024CE301316339E3A8B -S123338031303D86301633D83A31303D36862D7A302F3240800150C001C30001209B3687DA -S12333A06A300436FB323D6A300436FB3D36A63027051633D820F7323D3635341633DF27F2 -S12333C0FB810D270A6A301633D803270220ED860A1633D83031323D4FCC80FC5ACF3D4F6E -S12333E0CC200396CF3D873D496E76616C696420496E7075740D0A00436C6F636B3E20001C -S1233400434D443E20004572726F723E2000496E76616C696420496E7075740D0A004F763B -S12334206572666C6F77204572726F720D0A00436C6F636B2073746F7070656420616E645A -S1233440205479706577726974652070726F6772616D20737461727465642E0D0A596F75CA -S1233460206D617920747970652062656C6F772E0D0A00436F6D6D616E64733A0D0A743A50 -S123348020536574207468652074696D6520696E20666F726D61742048483A4D4D3A5353A8 -S12334A00D0A683A20446973706C61792074686520686F757273206F6E20746865203720D2 -S12334C07365676D656E7420646973706C6179730D0A6D3A20446973706C61792074686557 -S12334E0206D696E75746573206F6E207468652037207365676D656E7420646973706C613E -S123350079730D0A733A20446973706C617920746865207365636F6E6473206F6E20746898 -S1233520652037207365676D656E7420646973706C6179730D0A713A2053746F70207468AB -S12235406520636C6F636B20616E6420656E74657220747970657772697465720D0A00B0 -S105FFF0316476 +S1233100CF310086F15A03860C5ACBCC00015CC8CE34901633F24C3B194C38804C37808635 +S1233120FF5A03CE3030FD30401633E310EF1631B9CE3030FD30401633FECE3030163266AB +S1233140CE3030FD30401633E314101631B910EF20DF14104D3880CE344C1633F216341F67 +S12331609727FA5A0116341820F34C3780FE302C087E302C8E00C8263FCE00007E302CFE23 +S1233180302A087E302A8E003C262ACE00007E302AFE3028087E30288E003C2618CE000027 +S12331A07E3028FE3026087E30268E00182606CE00007E30261631B90B3B3534860D163405 +S12331C018860A163418CE34281633F2FC30268C000A240736863016341832CD30001633A3 +S12331E074863A163418FC30288C000A240736863016341832CD3000163374863A163418C4 +S1233200FC302A8C000A240736863016341832CD300016337486201634181634181634188D +S1233220163418CE34301633F2CE30301633F2B6304281682605FC3026200C816D2605FC83 +S123324030282003FC302A16324E30313A3D3B34CE000A181037B7D4CE000A58585858EAD8 +S1233260B05B01303A3D3B35A630182700B081742654A620812027FA1410163321B7E48CB6 +S12332800018247C8C00002D777C3026A61F813A266E163321B7E48C003C24648C00002D4E +S12332A05F7C3028A61F813A2656163321B7E48C003C244C8C00002D477C302AA61F810082 +S12332C0263E10EF20588168260BE630C10026307A30422049816D260BE630C10026217ABC +S12332E03042203A8173260BE630C10026127A3042202B81712609E630C1002603063152E9 +S123330010EF348620163418163418163418163418CE34361633F2CE343E1633F230313ABF +S12333203D3BCD0000E630272EC12B272AC12D2726C12A2722C12F271EC13A271AC12027B4 +S123334016C1302D17C1392213C03037CC000A13B7C63319ED20CE87B7023A3D8604B70241 +S12333603A3D343536A67F27056A3020F8876A303231303D34353B8C0000274C2D533635B1 +S1233380348630CE3013CD00051633EC3031876A4032CE000A18108E00002708CB306B60E0 +S12333A0B7D420EE8C000026F3B6302F812D26026A60CE30131633621633F2FD3024CE30D0 +S12333C0131633E33A31303D86301634183A31303D36862D7A302F3240800150C001C30059 +S12333E001209B36876A300436FB323D6A300436FB3D36A630270516341820F7323D36357B +S12334003416341F27FB810D270A6A3016341803270220ED3031323D4FCC80FC5ACF3D4FD9 +S1233420CC200396CF3D873D436C6F636B3E2000434D443E20004572726F723E2000496E98 +S123344076616C696420496E70757400436C6F636B2073746F7070656420616E64205479DD +S1233460706577726974652070726F6772616D20737461727465642E0D0A596F75206D61A9 +S12334807920747970652062656C6F772E0D0A00436F6D6D616E64733A0D0A743A20536546 +S12334A074207468652074696D6520696E20666F726D61742048483A4D4D3A53530D0A68E1 +S12334C03A20446973706C61792074686520686F757273206F6E20746865203720736567F2 +S12334E06D656E7420646973706C6179730D0A6D3A20446973706C617920746865206D6980 +S12335006E75746573206F6E207468652037207365676D656E7420646973706C6179730D1A +S12335200A733A20446973706C617920746865207365636F6E6473206F6E207468652037B5 +S1233540207365676D656E7420646973706C6179730D0A713A2053746F702074686520635F +S11F35606C6F636B20616E6420656E74657220747970657772697465720D0A007B +S105FFF0316A70 S9030000FC diff --git a/cmpen472_hw8McDonnell/bin/main.dbg b/cmpen472_hw8McDonnell/bin/main.dbg index ee34a63..6d18ef7 100644 --- a/cmpen472_hw8McDonnell/bin/main.dbg +++ b/cmpen472_hw8McDonnell/bin/main.dbg @@ -99,9 +99,9 @@ outputBuf dc.b 'h' ; Used to control what to output on 7 se * * There is a section Data Section at the end of the file ************************************************************************** -* Interrupt Vector Section: address used [ $FFF0 to $FFFF ] RAM Memory +* RTI Vector Section: address used [ $FFF0 to $FFF1 ] RAM Memory * - org $FFF0 ; Memory location for Interrupt vector section for simulator + org $FFF0 ; Memory location for RTI interrupt vector section for simulator dc.w rtiisr ; Real Time Interrupt vector * ************************************************************************** @@ -127,6 +127,9 @@ pgstart lds #$3100 ; initialize the stack pointer bset CRGINT,%10000000; enable RTI interrupt bset CRGFLG,%10000000; clear RTI IF (Interrupt Flag) + ldaa #$FF ; Two 7 segment displays on PORTB + staa DDRB ; Set all of PORTB as output + ldx #inputBuffer ; Load the address of inputBuffer into X ldy lenInput ; Load the length of inputBuffer into Y jsr Zeros ; Zero out inputBuffer @@ -158,6 +161,7 @@ TypeWrite twLoop jsr getchar ; Read a character from the serial console tsta ; Compare A to 0 beq twLoop ; If A == 0, branch to twLoop + staa PORTB ; Write A to PORTB jsr putchar ; Write character to serial console bra twLoop ; Branch always to twLoop @@ -166,12 +170,11 @@ twLoop jsr getchar ; Read a character from the serial conso * rtiisr bset CRGFLG,%10000000; Clear RTI Interrupt Flag - pshx ; Save X to the stack ldx counter ; Load counter into X inx ; Increment counter by 1 stx counter ; Save X to counter - cpx #9000 ; Compare counter to 9000, This is about 1 second on my computer - bne rtiSkip ; If counter != 400, branch to rtiSkip + cpx #200 ; Compare counter to 200, This is about 1 second on my computer + bne rtiSkip ; If counter != 200, branch to rtiSkip ldx #0 ; Load 0 into X stx counter ; Save X to counter ldx seconds ; Load the seconds into X @@ -196,8 +199,7 @@ rtiisr bset CRGFLG,%10000000; Clear RTI Interrupt Flag ldx #0 ; Reset the hours stx hours ; Save the updated hours rtidone jsr PrintTime ; Jump to PrintTime -rtiSkip pulx ; Restore X from the stack - RTI +rtiSkip RTI ; Return from RTI ISR PrintTime pshd ; Save D to the stack @@ -249,11 +251,40 @@ goodSecs ldy #buffer ; Load the address of buffer into Y jsr WriteString ; Write the string to the serial ldx #inputBuffer ; Load the address of the inputBuffer into X jsr WriteString ; Write the string to the serial + ldaa outputBuf ; Load outputBuf into A + cmpa #'h' ; Compare A to 'h' + bne pTimeIsM ; If A != 'h', branch to pTimeIsM + ldd hours ; Load hours into B + bra skipRest ; Jump to skipRest +pTimeIsM cmpa #'m' ; Compare A to 'm' + bne pTimeIsS ; If A != 'm', branch to pTimeIsS + ldd minutes ; Load Minutes into D + bra skipRest ; Jump to skipRest +pTimeIsS ldd seconds ; Load seconds into D +skipRest jsr TimeOnPortB ; Call TimeOnPortB to output time pulx ; Restore X from the stack puly ; Restore Y from the stack puld ; Restore D from the stack rts ; Return to caller +TimeOnPortB + pshd ; Save D to the stack + pshx ; Save X to the stack + ldx #10 ; Load 10 into X to get digit + idiv ; Divide D by X and save Digit into D + pshb ; Save B to the stack (Lower Byte of D) + exg x,d ; Swap X and D + ldx #10 ; Load 10 into X to get digit + lslb ; Shift B left by 1 + lslb ; Shift B left by 1 + lslb ; Shift B left by 1 + lslb ; Shift B left by 1 + orab 1,sp+ ; Or B with Digit on stack + stab PORTB ; Save B to PORTB + pulx ; Restore X from the stack + puld ; Restore D from the stack + rts ; Return from caller + ExecuteCommand pshd ; Save D to the stack pshy ; Save Y to the stack @@ -326,6 +357,11 @@ isQ cmpa #'q' ; Compare A to 'q' jmp TypeWrite ; Jump to TypeWrite badCommand cli ; Reenable interrupts pshx ; Save X to the stack + ldaa #' ' ; Load Space character into A + jsr putchar ; Jump to putchar to write space character + jsr putchar ; Jump to putchar to write space character + jsr putchar ; Jump to putchar to write space character + jsr putchar ; Jump to putchar to write space character ldx #error ; Load the address of the error prompt into X jsr WriteString ; Jump to WriteString ldx #badInput ; Load the address of badInput into X @@ -583,9 +619,7 @@ readLoop jsr getchar ; Jump to putchar to write byte to seria dey ; Decrement Y by 1 beq doneRead ; If Y == 0, no more room, stop reading bra readLoop ; branch always to readLoop -doneRead ldaa #LF ; Load Line Feed into A - jsr putchar ; Write LF to terminal - pulx ; Restore X from the stack +doneRead pulx ; Restore X from the stack pulY ; Restore Y from the stack pula ; restore A from the stack rts ; return to caller @@ -627,17 +661,13 @@ getchar7 clra ; Set A to 0 * Data Section 2: address used [ $3100 to $3FFF ] RAM Memory * -invalidStr dc.b 'Invalid Input',CR,LF,NULL ; Invalid input error message - clock dc.b 'Clock> ',NULL ; Prompt string for clock CMD dc.b 'CMD> ',NULL ; Prompt string for CMD error dc.b 'Error> ',NULL ; Prompt string for errors -badInput dc.b 'Invalid Input',CR,LF,NULL ; Invalid Input Prompt - -overflow dc.b 'Overflow Error',CR,LF,NULL ; Overflow error message +badInput dc.b 'Invalid Input',NULL ; Invalid Input Prompt ; twMsg: welcome message for typewrite twMsg dc.b 'Clock stopped and Typewrite program started.',CR,LF diff --git a/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/ObjectCode/main.asm.o b/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/ObjectCode/main.asm.o Binary files differindex 6a529c1..0d33129 100644 --- a/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/ObjectCode/main.asm.o +++ b/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/ObjectCode/main.asm.o diff --git a/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/ObjectCode/main.asm.sx b/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/ObjectCode/main.asm.sx index 3797fdd..0ba80b1 100644 --- a/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/ObjectCode/main.asm.sx +++ b/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/ObjectCode/main.asm.sx @@ -2,40 +2,41 @@ S0840000433A5C55736572735C4A61636F62204D63446F6E6E656C6C5C446F63756D656E74735C43 S123300000000000000000000000000000000000000010000000000000000000000000009C S123302000000000001000000000000000000000000000000000000000000000000000007C S106304000106811 -S105FFF0316476 -S1233100CF310086F15A03860C5ACBCC00015CC8CE34731633AD4C3B194C38804C3780CE4F -S12331203030FD304016339E10EF1631B5CE3030FD30401633B9CE303016322FCE3030FD6F -S1233140304016339E14101631B510EF20DF14104D3880CE342F1633AD1633DF9727FA16B0 -S123316033D820F54C378034FE302C087E302C8E2328263FCE00007E302CFE302A087E30C4 -S12331802A8E003C262ACE00007E302AFE3028087E30288E003C2618CE00007E3028FE3033 -S12331A026087E30268E00182606CE00007E30261631B5300B3B3534860D1633D8860A1660 -S12331C033D8CE33F81633ADFC30268C000A24073686301633D832CD300016332F863A1654 -S12331E033D8FC30288C000A24073686301633D832CD300016332F863A1633D8FC302A8C34 -S1233200000A24073686301633D832CD300016332F86201633D81633D81633D81633D8CEC9 -S123322034001633ADCE30301633AD30313A3D3B35A630182700A281742654A62081202740 -S1233240FA14101632DCB7E48C0018247C8C00002D777C3026A61F813A266E1632DCB7E474 -S12332608C003C24648C00002D5F7C3028A61F813A26561632DCB7E48C003C244C8C00008F -S12332802D477C302AA61F8100263E10EF204A8168260BE630C10026307A3042203B816D51 -S12332A0260BE630C10026217A3042202C8173260BE630C10026127A3042201D8171260905 -S12332C0E630C100260306314E10EF34CE34061633ADCE340E1633AD30313A3D3BCD00004E -S12332E0E630272EC12B272AC12D2726C12A2722C12F271EC13A271AC1202716C1302D17EF -S1233300C1392213C03037CC000A13B7C63319ED20CE87B7023A3D8604B7023A3D343536B6 -S1233320A67F27056A3020F8876A303231303D34353B8C0000274C2D533635348630CE301F -S123334013CD00051633A73031876A4032CE000A18108E00002708CB306B60B7D420EE8C28 -S1233360000026F3B6302F812D26026A60CE301316331D1633ADFD3024CE301316339E3A8B -S123338031303D86301633D83A31303D36862D7A302F3240800150C001C30001209B3687DA -S12333A06A300436FB323D6A300436FB3D36A63027051633D820F7323D3635341633DF27F2 -S12333C0FB810D270A6A301633D803270220ED860A1633D83031323D4FCC80FC5ACF3D4F6E -S12333E0CC200396CF3D873D496E76616C696420496E7075740D0A00436C6F636B3E20001C -S1233400434D443E20004572726F723E2000496E76616C696420496E7075740D0A004F763B -S12334206572666C6F77204572726F720D0A00436C6F636B2073746F7070656420616E645A -S1233440205479706577726974652070726F6772616D20737461727465642E0D0A596F75CA -S1233460206D617920747970652062656C6F772E0D0A00436F6D6D616E64733A0D0A743A50 -S123348020536574207468652074696D6520696E20666F726D61742048483A4D4D3A5353A8 -S12334A00D0A683A20446973706C61792074686520686F757273206F6E20746865203720D2 -S12334C07365676D656E7420646973706C6179730D0A6D3A20446973706C61792074686557 -S12334E0206D696E75746573206F6E207468652037207365676D656E7420646973706C613E -S123350079730D0A733A20446973706C617920746865207365636F6E6473206F6E20746898 -S1233520652037207365676D656E7420646973706C6179730D0A713A2053746F70207468AB -S12235406520636C6F636B20616E6420656E74657220747970657772697465720D0A00B0 +S105FFF0316A70 +S1233100CF310086F15A03860C5ACBCC00015CC8CE34901633F24C3B194C38804C37808635 +S1233120FF5A03CE3030FD30401633E310EF1631B9CE3030FD30401633FECE3030163266AB +S1233140CE3030FD30401633E314101631B910EF20DF14104D3880CE344C1633F216341F67 +S12331609727FA5A0116341820F34C3780FE302C087E302C8E00C8263FCE00007E302CFE23 +S1233180302A087E302A8E003C262ACE00007E302AFE3028087E30288E003C2618CE000027 +S12331A07E3028FE3026087E30268E00182606CE00007E30261631B90B3B3534860D163405 +S12331C018860A163418CE34281633F2FC30268C000A240736863016341832CD30001633A3 +S12331E074863A163418FC30288C000A240736863016341832CD3000163374863A163418C4 +S1233200FC302A8C000A240736863016341832CD300016337486201634181634181634188D +S1233220163418CE34301633F2CE30301633F2B6304281682605FC3026200C816D2605FC83 +S123324030282003FC302A16324E30313A3D3B34CE000A181037B7D4CE000A58585858EAD8 +S1233260B05B01303A3D3B35A630182700B081742654A620812027FA1410163321B7E48CB6 +S12332800018247C8C00002D777C3026A61F813A266E163321B7E48C003C24648C00002D4E +S12332A05F7C3028A61F813A2656163321B7E48C003C244C8C00002D477C302AA61F810082 +S12332C0263E10EF20588168260BE630C10026307A30422049816D260BE630C10026217ABC +S12332E03042203A8173260BE630C10026127A3042202B81712609E630C1002603063152E9 +S123330010EF348620163418163418163418163418CE34361633F2CE343E1633F230313ABF +S12333203D3BCD0000E630272EC12B272AC12D2726C12A2722C12F271EC13A271AC12027B4 +S123334016C1302D17C1392213C03037CC000A13B7C63319ED20CE87B7023A3D8604B70241 +S12333603A3D343536A67F27056A3020F8876A303231303D34353B8C0000274C2D533635B1 +S1233380348630CE3013CD00051633EC3031876A4032CE000A18108E00002708CB306B60E0 +S12333A0B7D420EE8C000026F3B6302F812D26026A60CE30131633621633F2FD3024CE30D0 +S12333C0131633E33A31303D86301634183A31303D36862D7A302F3240800150C001C30059 +S12333E001209B36876A300436FB323D6A300436FB3D36A630270516341820F7323D36357B +S12334003416341F27FB810D270A6A3016341803270220ED3031323D4FCC80FC5ACF3D4FD9 +S1233420CC200396CF3D873D436C6F636B3E2000434D443E20004572726F723E2000496E98 +S123344076616C696420496E70757400436C6F636B2073746F7070656420616E64205479DD +S1233460706577726974652070726F6772616D20737461727465642E0D0A596F75206D61A9 +S12334807920747970652062656C6F772E0D0A00436F6D6D616E64733A0D0A743A20536546 +S12334A074207468652074696D6520696E20666F726D61742048483A4D4D3A53530D0A68E1 +S12334C03A20446973706C61792074686520686F757273206F6E20746865203720736567F2 +S12334E06D656E7420646973706C6179730D0A6D3A20446973706C617920746865206D6980 +S12335006E75746573206F6E207468652037207365676D656E7420646973706C6179730D1A +S12335200A733A20446973706C617920746865207365636F6E6473206F6E207468652037B5 +S1233540207365676D656E7420646973706C6179730D0A713A2053746F702074686520635F +S11F35606C6F636B20616E6420656E74657220747970657772697465720D0A007B S9033100CB diff --git a/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/TargetDataWindows.tdt b/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/TargetDataWindows.tdt Binary files differindex f0b3cf3..58b2dad 100644 --- a/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/TargetDataWindows.tdt +++ b/cmpen472_hw8McDonnell/cmpen472_hw8McDonnell_Data/Standard/TargetDataWindows.tdt |
