summaryrefslogtreecommitdiff
path: root/cmpen472hw9_McDonnell/bin
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2025-04-01 19:55:31 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2025-04-01 19:55:31 -0400
commitf3cbf7550e4168be261e0f54daddd5fdd1ec0226 (patch)
treea675c4a80d655f70426f2a304829c1fcc8224665 /cmpen472hw9_McDonnell/bin
parentfd3d5b220e20b5279a453739b42aae8becd69ca9 (diff)
HW9: Somewhat right output
Diffstat (limited to 'cmpen472hw9_McDonnell/bin')
-rw-r--r--cmpen472hw9_McDonnell/bin/Project.absbin9172 -> 9296 bytes
-rw-r--r--cmpen472hw9_McDonnell/bin/Project.abs.phy2
-rw-r--r--cmpen472hw9_McDonnell/bin/Project.abs.s1995
-rw-r--r--cmpen472hw9_McDonnell/bin/main.dbg68
4 files changed, 101 insertions, 64 deletions
diff --git a/cmpen472hw9_McDonnell/bin/Project.abs b/cmpen472hw9_McDonnell/bin/Project.abs
index 782e71a..f048be5 100644
--- a/cmpen472hw9_McDonnell/bin/Project.abs
+++ b/cmpen472hw9_McDonnell/bin/Project.abs
Binary files differ
diff --git a/cmpen472hw9_McDonnell/bin/Project.abs.phy b/cmpen472hw9_McDonnell/bin/Project.abs.phy
index 6675b33..08fa00f 100644
--- a/cmpen472hw9_McDonnell/bin/Project.abs.phy
+++ b/cmpen472hw9_McDonnell/bin/Project.abs.phy
@@ -1,3 +1,3 @@
S0580000433A5C55736572735C4A61636F62204D63446F6E6E656C6C5C446F63756D656E74735C434D50454E2D3437322D48575C636D70656E3437326877395F4D63446F6E6E656C6C5C62696E5C50726F6A6563742E61627347
-S2060FFFF0316A60
+S2060FFFF0317456
S9030000FC
diff --git a/cmpen472hw9_McDonnell/bin/Project.abs.s19 b/cmpen472hw9_McDonnell/bin/Project.abs.s19
index 60fd630..33c4566 100644
--- a/cmpen472hw9_McDonnell/bin/Project.abs.s19
+++ b/cmpen472hw9_McDonnell/bin/Project.abs.s19
@@ -2,51 +2,52 @@ S0580000433A5C55736572735C4A61636F62204D63446F6E6E656C6C5C446F63756D656E74735C43
S123300000000000000000000000000000000000000010000000000000000000000000009C
S123302000000000001000000000000000000000000000000000000000000000000000007C
S106304000106811
-S1233100CF310086F15A03860C5ACBCC00015CC8CE35BF16350E4C3B194C38804C378086E7
-S1233120FF5A03CE3030FD30401634FF10EF1631B9CE3030FD304016351ACE303016326670
-S1233140CE3030FD30401634FF14101631B910EF20DF14104D3880CE357916350E16353BE1
-S12331609727FA5A0116353420F34C3780FE302C087E302C8E00C8263FCE00007E302CFE06
-S1233180302A087E302A8E003C262ACE00007E302AFE3028087E30288E003C2618CE000027
-S12331A07E3028FE3026087E30268E00182606CE00007E30261631B90B3B3534860D163504
-S12331C034860A163534CE354416350EFC30268C000A240736863016353432CD3000163411
-S12331E090863A163534FC30288C000A240736863016353432CD3000163490863A16353434
-S1233200FC302A8C000A240736863016353432CD30001634908620163534163534163534FC
-S1233220163534CE354C16350ECE303016350EB6304281682605FC3026200C816D2605FC0D
-S123324030282003FC302A16324E30313A3D3B34CE000A181037B7D4CE000A58585858EAD8
-S1233260B05B01303A3D3B35A630182700E08174266DA620812027FA1410FC30263B163427
-S12332803DB7E48C0018182400A28C0000182D009B7C3026A61F813A18260090FC30283BB5
-S12332A016343DB7E48C003C247E8C00002D797C3028A61F813A2670FC302A3B16343DB793
-S12332C0E48C003C245E8C00002D597C302AA61F81002650877A302C10EF3A3A3A206F81FE
-S12332E068260BE630C10026497A30422060816D260BE630C100263A7A30422051817326B2
-S12333000BE630C100262B7A3042204281712609E630C100261C063152091633D4271316EF
-S12333203351202A3A7C302A3A7C30283A7C302610EF3486201635341635341635341635F0
-S123334034CE355216350ECE355A16350E30313A3D353B3416343D35A61F16343D812B277A
-S123336013812D271A812A2721B7E531B7E41810B7D4201F7D302E31B7E4F3302E20147D51
-S1233380302E31B7E4B3302E2009B7E431138D000026288C270F2E238CD8F12D1E301635DD
-S12333A00E36863D16353432CD3000163490860D163534860A1635343A313D303416350EF4
-S12333C0860D163534860A163534CE356816350E303A313D353B34C77B302FCD0000A63044
-S12333E08139222081302D08028D0004221620EE812B271B812D2717812A2713812F270F69
-S123340081002723876A008604B702303A313D7A302FA61E81302DEC813922E8CB01C10118
-S123342022E2CD000020B7A61E81302DD7813922D3B6302F27CE87B702303A313D3BCD008E
-S123344000E630272EC12B272AC12D2726C12A2722C12F271EC13A271AC1202716C1302DA4
-S123346017C1392213C03037CC000A13B7C63319ED20CE87B7023A3D8604B7023A3D343574
-S123348036A67F27056A3020F8876A303231303D34353B8C0000274C2D533635348630CEB8
-S12334A03013CD00051635083031876A4032CE000A18108E00002708CB306B60B7D420EEC0
-S12334C08C000026F3B6302F812D26026A60CE301316347E16350EFD3024CE30131634FFB1
-S12334E03A31303D86301635343A31303D36862D7A302F3240800150C001C30001209B3668
-S1233500876A300436FB323D6A300436FB3D36A630270516353420F7323D36353416353B74
-S123352027FB810D270A6A3016353403270220ED3031323D4FCC80FC5ACF3D4FCC200396B3
-S1233540CF3D873D436C6F636B3E2000434D443E20004572726F723E2000496E76616C6950
-S12335606420496E707574004F766572666C6F77204572726F720D0A000D0A436C6F636B1B
-S12335802073746F7070656420616E64205479706577726974652070726F6772616D20731D
-S12335A07461727465642E0D0A596F75206D617920747970652062656C6F772E0D0A0043F7
-S12335C06F6D6D616E64733A0D0A743A20536574207468652074696D6520696E20666F721F
-S12335E06D61742048483A4D4D3A53530D0A683A20446973706C61792074686520686F75A5
-S12336007273206F6E207468652037207365676D656E7420646973706C6179730D0A6D3AB2
-S123362020446973706C617920746865206D696E75746573206F6E2074686520372073655D
-S1233640676D656E7420646973706C6179730D0A733A20446973706C617920746865207314
-S123366065636F6E6473206F6E207468652037207365676D656E7420646973706C61797379
-S12336800D0A713A2053746F702074686520636C6F636B20616E6420656E74657220747973
-S10E36A070657772697465720D0A0092
-S105FFF0316A70
+S1233100CF310086F15A03860C5ACBCC00015CC8CE35F11635424C3B194C38804C37808681
+S1233120FF5A03CE3030FD304016353310EF1631C616324FCE3030FD304016354ECE303011
+S1233140163276CE3030A60027EAFD304016353314101631C616324F10EF20D814104D3875
+S123316080CE35AB16354216356F9727FA5A0116356820F34C3780FE302C087E302C8E0030
+S1233180C82642CE00007E302CFE302A087E302A8E003C262ACE00007E302AFE3028087E7F
+S12331A030288E003C2618CE00007E3028FE3026087E30268E00182606CE00007E3026164D
+S12331C031C616324F0B3B3534860D163568860A163568CE3578163542FC30268C000A2411
+S12331E00736863016356832CD30001634C4863A163568FC30288C000A2407368630163529
+S12332006832CD30001634C4863A163568FC302A8C000A240736863016356832CD30001697
+S123322034C48620163568163568163568163568B6304281682605FC3026200C816D26054D
+S1233240FC30282003FC302A16325E30313A3D34CE3580163542CE3030163542303D3B3444
+S1233260CE000A181037B7D4CE000A58585858EAB05B01303A3D3B35A630182700E0817459
+S1233280266DA620812027FA1410FC30263B163471B7E48C0018182400A28C0000182D00B5
+S12332A09B7C3026A61F813A18260090FC30283B163471B7E48C003C247E8C00002D797C52
+S12332C03028A61F813A2670FC302A3B163471B7E48C003C245E8C00002D597C302AA61F9E
+S12332E081002650877A302C10EF3A3A3A206F8168260BE630C10026497A30422060816D80
+S1233300260BE630C100263A7A304220518173260BE630C100262B7A304220428171260928
+S1233320E630C100261C06315C091634082713163361202A3A7C302A3A7C30283A7C30262A
+S123334010EF348620163568163568163568163568CE3586163542CE358E16354230313AF5
+S12333603D353B3416347135A61F163471812B2713812D271A812A2721B7E531B7E41810A0
+S1233380B7D4201F7D302E31B7E4F3302E20147D302E31B7E4B3302E2009B7E431138D00E6
+S12333A00026428C270F2E3D8CD8F12D3814101631C6303416354230FD30401635333686C1
+S12333C03D16356832CD30001634C4862016356816356816356816356816324F877A302F53
+S12333E010EF3A313D8620163568163568163568163568CE35861635428620163568CE353E
+S12334009C163542303A313D353B34C77B302FCD0000A6308139222081302D08028D00044A
+S1233420221620EE812B271B812D2717812A2713812F270F81002723876A008604B702306E
+S12334403A313D7A302FA61E81302DEC813922E8CB01C10122E2CD000020B7A61E81302DBD
+S1233460D7813922D3B6302F27CE87B702303A313D3BCD0000E630272EC12B272AC12D27DB
+S123348026C12A2722C12F271EC13A271AC1202716C1302D17C1392213C03037CC000A13CB
+S12334A0B7C63319ED20CE87B7023A3D8604B7023A3D343536A67F27056A3020F8876A3030
+S12334C03231303D34353B8C0000274C2D533635348630CE3013CD000516353C3031876AE4
+S12334E04032CE000A18108E00002708CB306B60B7D420EE8C000026F3B6302F812D2602AA
+S12335006A60CE30131634B2163542FD3024CE30131635333A31303D86301635683A313087
+S12335203D36862D7A302F3240800150C001C30001209B36876A300436FB323D6A30043636
+S1233540FB3D36A630270516356820F7323D36353416356F27FB810D270A6A301635680334
+S1233560270220ED3031323D4FCC80FC5ACF3D4FCC200396CF3D873D5463616C633E20005B
+S1233580434D443E20004572726F723E2000496E76616C696420496E707574004F766572FA
+S12335A0666C6F77204572726F72000D0A436C6F636B2073746F7070656420616E6420543C
+S12335C079706577726974652070726F6772616D20737461727465642E0D0A596F75206D30
+S12335E0617920747970652062656C6F772E0D0A00436F6D6D616E64733A0D0A743A2053E9
+S12336006574207468652074696D6520696E20666F726D61742048483A4D4D3A53530D0A82
+S1233620683A20446973706C61792074686520686F757273206F6E2074686520372073658F
+S1233640676D656E7420646973706C6179730D0A6D3A20446973706C617920746865206D20
+S1233660696E75746573206F6E207468652037207365676D656E7420646973706C6179735D
+S12336800D0A733A20446973706C617920746865207365636F6E6473206F6E20746865207E
+S12336A037207365676D656E7420646973706C6179730D0A713A2053746F7020746865202A
+S12036C0636C6F636B20616E6420656E74657220747970657772697465720D0A00B6
+S105FFF0317466
S9030000FC
diff --git a/cmpen472hw9_McDonnell/bin/main.dbg b/cmpen472hw9_McDonnell/bin/main.dbg
index 5a7a005..bc272cf 100644
--- a/cmpen472hw9_McDonnell/bin/main.dbg
+++ b/cmpen472hw9_McDonnell/bin/main.dbg
@@ -133,6 +133,7 @@ pgstart lds #$3100 ; initialize the stack pointer
jsr Zeros ; Zero out inputBuffer
cli ; Enable interrupts
jsr PrintTime ; Jump to PrintTime to write to serial console
+ jsr PrintPrompt ; Jump to PrintPrompt to write to serial console
mainLoop
ldx #inputBuffer ; Load the address of inputBuffer into X
ldy lenInput ; Load the length of inputBuffer into Y
@@ -142,11 +143,14 @@ mainLoop
jsr ExecuteCommand ; Jump to ExecuteCommand
ldx #inputBuffer ; Load the address of inputBuffer into X
+ ldaa 0,x ; Load first character from inputBuffer into A
+ beq mainLoop ; If A == 0, branch to mainLoop, only zero if Solve was called
ldy lenInput ; Load the length of inputBuffer into Y
jsr Zeros ; Zero out inputBuffer
sei ; Disable interrupts
jsr PrintTime ; Jump to PrintTime to print new time
+ jsr PrintPrompt ; Jump to PrintPrompt to write to serial console
cli ; Enable interrupts
bra mainLoop ; Loop back to mainLoop always
@@ -215,6 +219,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
+ jsr PrintPrompt ; Jump to PrintPrompt
rtiSkip RTI ; Return from RTI ISR
;*************************************************************************
@@ -281,10 +286,6 @@ goodSecs ldy #buffer ; Load the address of buffer into Y
jsr putchar ; Write the character to the serial console
jsr putchar ; Write the character to the serial console
jsr putchar ; Write the character to the serial console
- ldx #CMD ; Load the address of CMD into X
- 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
@@ -302,6 +303,28 @@ skipRest jsr TimeOnPortB ; Call TimeOnPortB to output time
rts ; Return to caller
;*************************************************************************
+; PrintPrompt subroutine
+;
+; This subroutine will output the CMD prompt and any current input to the serial console
+;
+; Input: No Input
+; Output: The CMD prompt and any input onto the serial console
+; Registers in use: X for addresses of strings
+; Memory locations in use: PORTB memory location, CMD prompt memory locaiton, inputBuffer location
+;
+; Comments: This subroutine requires WriteString subroutine.
+;
+
+PrintPrompt
+ pshx ; Save X to the stack
+ ldx #CMD ; Load the address of CMD into X
+ 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
+ pulx ; Restore X from the stack
+ rts
+
+;*************************************************************************
; TimeOnPortB subroutine
;
; This subroutine will output the time given on on PORTB for two seven segment displays.
@@ -510,28 +533,41 @@ sDone cpd #9999 ; Compare D to 9999 (Max output)
bgt sOverflow ; Branch to sOverflow if D > 9999
cpd #-9999 ; Compare D to -9999 (Min output)
blt sOverflow ; Branch to sOverflow if D < -9999
+ sei ; Disable Interrupts
+ jsr PrintTime ; Print Time to serial
pulx ; Restore X from the stack
+ pshx ; Save X to the stack
jsr WriteString ; Write original equation to serial console
+ pulx ; Restore X from the stack
+ ldy lenInput ; Load the length of the input buffer into Y
+ jsr Zeros ; Clear input buffer
psha ; Save A to the stack
ldaa #'=' ; Load '=' into A
jsr putchar ; Print '=' to serial console
pula ; Restore A from the stack
ldy #buffer ; Load address of buffer into Y
jsr PrintDecimalWord; Print the answer to the Serial console
- ldaa #CR ; Load CR into A
- jsr putchar ; Jump to putchar to write CR
- ldaa #LF ; Load LF into A
- jsr putchar ; Jump to putchar to write CR
+ ldaa #' ' ; Load a space character into A
+ jsr putchar ; Write space character to serial
+ jsr putchar ; Write space character to serial
+ jsr putchar ; Write space character to serial
+ jsr putchar ; Write space character to serial
+ jsr PrintPrompt ; Write CMD prompt to serial
+ clra ; Clear A
+ staa operator ; Clear operator
+ cli ; Enable Interrupts
puld ; Restore D from the stack
puly ; Restore Y from the stack
rts ; Return to caller
-sOverflow pulx ; Restore X from the stack
- pshx ; Save X to the stack
+sOverflow ldaa #' ' ; Load a 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 ; Write original string to serial console
- ldaa #CR ; Load CR into A
- jsr putchar ; Jump to putchar to write CR
- ldaa #LF ; Load LF into A
- jsr putchar ; Jump to putchar to write CR
+ ldaa #' ' ; Load a space character into A
+ jsr putchar ; Jump to putchar to write space character
ldx #overflow ; Load address of overflow string into X
jsr WriteString ; Write overflow string to serial
pulx ; Restore X from the stack
@@ -904,7 +940,7 @@ getchar7 clra ; Set A to 0
* Data Section 2: address used [ $3100 to $3FFF ] RAM Memory
*
-clock dc.b 'Clock> ',NULL ; Prompt string for clock
+clock dc.b 'Tcalc> ',NULL ; Prompt string for clock
CMD dc.b 'CMD> ',NULL ; Prompt string for CMD
@@ -912,7 +948,7 @@ error dc.b 'Error> ',NULL ; Prompt string for errors
badInput dc.b 'Invalid Input',NULL ; Invalid Input Prompt
-overflow dc.b 'Overflow Error',CR,LF,NULL ; Overflow error message
+overflow dc.b 'Overflow Error',NULL ; Overflow error message
; twMsg: welcome message for typewrite
twMsg dc.b CR,LF,'Clock stopped and Typewrite program started.',CR,LF