You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/monitor.asm
+19-32Lines changed: 19 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -172,6 +172,7 @@ bmfs_next:
172
172
call[ProgramLocation] ; Execute program
173
173
174
174
poll:
175
+
; TODO - Check if already on column 0.. if so, skip to poll_nonewline
175
176
movrsi, newline
176
177
call ui_output
177
178
poll_nonewline:
@@ -181,6 +182,8 @@ poll_nonewline:
181
182
movrcx,100
182
183
call ui_input
183
184
jrcxz poll ; input stores the number of characters received in RCX
185
+
movrsi, newline
186
+
call ui_output
184
187
movrsi,rdi
185
188
call string_parse ; Remove extra spaces
186
189
jrcxz poll ; string_parse stores the number of words in RCX
@@ -503,10 +506,6 @@ dump:
503
506
jmp poll
504
507
505
508
dump_b:
506
-
pushrsi
507
-
movrsi, newline
508
-
call ui_output
509
-
poprsi
510
509
movrax,rsi
511
510
call dump_rax ; Display the memory address
512
511
pushrsi
@@ -545,10 +544,6 @@ dump_b_newline:
545
544
jmp dump_b
546
545
547
546
dump_w:
548
-
pushrsi
549
-
movrsi, newline
550
-
call ui_output
551
-
poprsi
552
547
movrax,rsi
553
548
call dump_rax
554
549
pushrsi
@@ -573,10 +568,6 @@ dump_w_newline:
573
568
jmp dump_w
574
569
575
570
dump_d:
576
-
pushrsi
577
-
movrsi, newline
578
-
call ui_output
579
-
poprsi
580
571
movrax,rsi
581
572
call dump_rax
582
573
pushrsi
@@ -601,10 +592,6 @@ dump_d_newline:
601
592
jmp dump_d
602
593
603
594
dump_q:
604
-
pushrsi
605
-
movrsi, newline
606
-
call ui_output
607
-
poprsi
608
595
movrax,rsi
609
596
call dump_rax
610
597
pushrsi
@@ -635,10 +622,10 @@ peek:
635
622
cmp byte [args],3
636
623
jl insuf
637
624
jg toomany
638
-
pushrsi
639
-
movrsi, newline
640
-
call ui_output
641
-
poprsi
625
+
; push rsi
626
+
; mov rsi, newline
627
+
; call ui_output
628
+
; pop rsi
642
629
movrsi, temp_string
643
630
call string_length
644
631
addrsi,1
@@ -739,7 +726,7 @@ poke_q:
739
726
jmp poke_end
740
727
741
728
poke_end:
742
-
jmppoll
729
+
jmppoll_nonewline
743
730
744
731
help:
745
732
movrsi, message_help
@@ -1233,11 +1220,11 @@ hextable: db '0123456789ABCDEF'
1233
1220
; Strings
1234
1221
1235
1222
prompt: db '> ',0
1236
-
message_ver: db 10,'1.0',0
1237
-
message_load: db 10,'Enter file number: ',0
1238
-
message_unknown: db 10,'Unknown command',0
1239
-
message_noFS: db 10,'No filesystem detected',0
1240
-
message_help: db 10,'Available commands:',10,'cls - clear the screen',10,'dir - Show programs currently on disk',10,'load - Load a program to memory (you will be prompted for the program number)',10,'exec - Run the program currently in memory',10,'ver - Show the system version',10,'peek - hex mem address and bytes (1, 2, 4, or 8) - ex "peek 2000008" to read 8 bytes',10,'poke - hex mem address and hex value (1, 2, 4, or 8 bytes) - ex "poke 200000 00ABCDEF" to write 4 bytes',10,'dump - hex mem address, hex amount, bytes (1, 2, 4, or 8) - ex "dump 100000104"',0
1223
+
message_ver: db '1.0',0
1224
+
message_load: db 'Enter file number: ',0
1225
+
message_unknown: db 'Unknown command',0
1226
+
message_noFS: db 'No filesystem detected',0
1227
+
message_help: db 'Available commands:',10,'cls - clear the screen',10,'dir - Show programs currently on disk',10,'load - Load a program to memory (you will be prompted for the program number)',10,'exec - Run the program currently in memory',10,'ver - Show the system version',10,'peek - hex mem address and bytes (1, 2, 4, or 8) - ex "peek 2000008" to read 8 bytes',10,'poke - hex mem address and hex value (1, 2, 4, or 8 bytes) - ex "poke 200000 00ABCDEF" to write 4 bytes',10,'dump - hex mem address, hex amount, bytes (1, 2, 4, or 8) - ex "dump 100000104"',0
1241
1228
command_exec: db 'exec',0
1242
1229
command_cls: db 'cls',0
1243
1230
command_dir: db 'dir',0
@@ -1265,12 +1252,12 @@ macsep: db ':', 0
1265
1252
dumpsep: db ': ',0
1266
1253
newline: db 10,0
1267
1254
tab: db 9,0
1268
-
insufargs: db 10,'Insufficient argument(s)',0
1269
-
toomanyargs: db 10,'Too many arguments',0
1270
-
invalidargs: db 10,'Invalid argument(s)',0
1271
-
dirmsg: db 10,'# Name Size',10,'-----------------------------',0
1272
-
dirmsgbmfs: db 10,'BMFS',0
1273
-
dirmsgramfs: db 10,'RAMFS',0
1255
+
insufargs: db 'Insufficient argument(s)',0
1256
+
toomanyargs: db 'Too many arguments',0
1257
+
invalidargs: db 'Invalid argument(s)',0
1258
+
dirmsg: db '# Name Size',10,'-----------------------------',0
0 commit comments