TinyMon Version 1.0 Written by JIM BUTTERFIELD --------------------------------------------------------------------------------------------------- Jim Butterfield wrote this for one reason. Ha had no ML Monitor back then. So best solution was obviously DIY strategy back in the days. You will notice, it is a ML Monitor for hard core users! To start it, just drag/drop the TinyMon image on the VIC20 emulation screen/ {make sure you have only default RAM set, no expansions} You can also load it with LOAD"*",8:RUN --------------------------------------------------------------------------------------------------- tinymon jim butterfield b* pc sr ac xr yr sp .;1b1a 31 40 1b 00 f6 Pure classic by Jim Butterfield, nice! --------------------------------------------------------------------------------------------------- And when you hit X and ENTER you get: --------------------------------------------------------------------------------------------------- 100 print"Sqqr]]] tiny mon 110 print"q jim butter field" 120 sys(peek(43)+256*p eek(44)+078) ready. Another classic! That were good old times back then! --------------------------------------------------------------------------------------------------- What does it offer? --------------------------------------------------------------------------------------------------- 6 {Actually 7} commands is what you get! Go back in 1982 when you basically had nothing {unless you paid for one} and you typed your Machine Code on the paper... in Machine Code! .: 0028 01 04 14 08 14 08 14 08 With the Machine Code Monitors {I am also writing Machine Language Monitors sometimes}, you had a tool in your hands which made your coding life much easier! Command Syntax Doing what? .R .R Will display the CPU registers {editable} .M .M 0400 0500 Will display bytes in this range {: editable} NOTE: No comma! .: .: 0340 18 60 This is CLC and RTS {It's how you would write a program} .G .G 0400 Start the execution from here .S .S"name",08,0400,0500 Saves the range to disk {usually the end address is +1 byte} .L .L"name",08 Load a previously saved file to memory .X .X Use to return to BASIC Note: All numbers are hexadecimal! --------------------------------------------------------------------------------------------------- Where can you enter your little tiny machine code {assembly} lines? Tape Buffer area was always a good target are: . m 0340 03ff {$bf, dec 101 bytes} {Note: You could start already at $33C, dec 828, but i am used to $0340} .:0340 00 00 00 00 00 .:0345 00 00 00 00 00 .:034a 00 00 00 00 00 .:034f 00 00 00 00 00 .:0354 00 00 00 00 00 .:0359 00 00 00 00 00 .:035e 00 00 00 00 00 .:0363 00 00 00 00 00 .:0368 00 00 00 00 00 .:036d 00 00 00 00 00 .:0372 00 00 00 00 00 .:0377 00 00 00 00 00 .:037c 00 00 00 00 00 .... .... .:03f0 00 00 00 00 00 .:03f5 00 00 00 00 00 .:03fa 00 00 00 00 00 .:03ff 00 04 04 04 04 . --------------------------------------------------------------------------------------------------- This is a very huge area to start practice coding in assembly language! But wait, where are .A and .D commands... Hmmm... Exactly! The only way to write a code here is to learn the OP-CODES and use .M command { .: that is} Basically, without a pen and paper, forget it. {well, a text editor will do the job to nowadays ;-)} Computer Magazines, respectively assembler source code listings, were a great source to get your hands on tokens and re-use them for own programs. You can re-use my code {which was used while testing PAL-Assembler for the VIC-20} And type this in: OP-CODES, {located just on the right from the addresses} and values in TinyMon. This code is a number one BASIC Helper {Check Pal-Assembler-Test for more details and examples} $0400 18 clc $0401 A2 00 ldx #$00 ;lines, poke 1026 $0403 a0 00 ldy #$00 ;column, poke 1028 $0405 20 f0 ff jsr $fff0 $0408 a0 00 ldx #$00 ;LOOP start poke 1033 {NEVER SET X > #$15, dec 21} $040a a9 20 lda #$20 ;SPACE poke 1035 {ASCII GFX Symbol} $040c 20 d2 ff jsr $ffd2 $040f e8 inx $0410 e0 16 cpx #$16 ;END LOOP poke 1041 {KEEP ALWAYS lower than LOOP START!} $0412 do f6 bne $040a $0414 60 rts --------------------------------------------------------------------------------------------------- For those who want to try to code like in good old days, i have here {further below} a listing with some {many} 6502 CPU commands and few other additions. This should be enough to bring HELLO WORLD on the screen with TinyMon! You could proceed like this: We know that a PRINT {BSOUT} is JSR $ffd2 and ASCII code for Clear Screen is 147, hex #$93 Return is RTS to go back to BASIC, $60 {You always use RTS to go back {return} after the JSR jump call!} You need to count bytes to have the correct following address {TinyMon can handle only 5 bytes per line} Decimal : 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Hex Numbers: 0 1 2 3 4 5 6 7 8 9 a b c d e f So, it's lda #$93, jsr $ffd2 = .:0340 A9 93 20 d2 ff .:0345 60 00 00 00 00 With this we wrote following: lda #$93 jsr $ffd2 rts If you call this from BASIC with SYS 832 it will delete the screen. 6502 is a little endian case, meaning first comes the low byte, then the high byte. Ergo, out of $ffd2, you'll see or must enter it as follows: $d2 {low byte} and $ff {high byte} = d2 ff in TinyMonitor --------------------------------------------------------------------------------------------------- . 01300 69 01 ADC #$01 . 01302 29 01 AND #$01 . 01304 0A ASL . 01305 90 F9 BCC $1300 . 01307 B0 F7 BCS $1300 . 01309 F0 F5 BEQ $1300 . 0130B 2C 01 13 BIT $1301 . 0130E 30 F0 BMI $1300 . 01310 D0 EE BNE $1300 . 01312 10 EC BPL $1300 . 01314 00 BRK . 01315 50 E9 BVC $1300 . 01317 70 E7 BVS $1300 . 01319 EA NOP . 0131A EA NOP . 0131B 18 CLC . 0131C D8 CLD . 0131D 58 CLI . 0131E B8 CLV . 0131F C9 0F CMP #$0F . 01321 E0 05 CPX #$05 . 01323 C0 08 CPY #$08 . 01325 CE 01 13 DEC $1301 . 01328 CA DEX . 01329 88 DEY . 0132A 4D 06 13 EOR $1306 . 0132D EE 03 13 INC $1303 . 01330 E8 INX . 01331 C8 INY . 01332 4C 1A 13 JMP $131A . 01335 20 1A 13 JSR $131A . 01338 A9 FF LDA #$FF . 0133A A2 20 LDX #$20 . 0133C A0 80 LDY #$80 . 0133E 4E 01 13 LSR $1301 . 01341 EA NOP . 01342 09 05 ORA #$05 . 01344 48 PHA . 01345 08 PHP . 01346 68 PLA . 01347 28 PLP . 01348 2A ROL . 01349 6A ROR . 0134A 40 RTI . 0134B 60 RTS . 0134C E9 0A SBC #$0A . 0134E 38 SEC . 0134F F8 SED . 01350 78 SEI . 01351 8d 0f 90 sta $900f . 01354 8e 0f 90 stx $900f . 01357 8c 0f 90 sty $900f . 0135A AA TAX . 0135B A8 TAY . 0135C BA TSX . 0135D 8A TXA . 0135E 9A TXS . 0135F 98 TYA ----------------------------------------------------------- . 01400 bd 00 15 lda $1500,x . 01403 b9 00 15 lda $1500,y . 01406 9d 00 15 sta $1500,x . 01409 99 00 15 sta $1500,y . 0140c dd 00 15 cmp $1500,x . 0140f d9 00 15 cmp $1500,y ----------------------------------------------------------- THIS WILL HELP YOU TO UNDERSTAND HOW IT IS BRANCHED. IT IS A RELATIVE ADDRESSING. YOU CAN JUM 128 BYTES UP or 128 DOWN {from the source = branch command} BRANCHING { LOWER ADDRESSES } . 01700 ea nop . 01701 ea nop . 01702 ea nop . 01703 d0 fd bne $1702 . 01705 d0 fa bne $1701 Why $fa, dec 250 in $1705? . 01707 d0 f7 bne $1700 = negative numbers are starting from $80 to $ff . 01709 ea nop = $d0, $fd, $d0, $ea, $ea = 5 = $ff - 5 = $fa . 0170a ea nop . 0170b ea nop . 0170c f0 fd beq $170b . 0170e f0 fa beq $170a . 01710 f0 f7 beq $1709 BRANCHING { HIGHER ADDRESSES } . 01800 d0 04 bne $1806 . 01802 d0 03 bne $1807 Why $03, dec 4 in $1802? . 01804 d0 02 bne $1808 = positive numbers are starting from $00 and up to 127 . 01806 ea nop = 00 {d0}, 01 {02}, 02 {ea}, 03 {ea} $1807 . 01807 ea nop . 01808 ea nop . 01809 f0 04 beq $180f . 0180b f0 03 beq $1810 . 0180d f0 03 beq $1812 . 0180f ea nop . 01810 a9 ff lda #$ff . 01812 ee 0f 90 inc $900f . 01815 --------------------------------------------------------------------------------------------------- Some characters @abcdefghijklmnopqrtsu vwyxz 01234567890 !#$%^&*()-=[] .m 1e00 1e40 .:1e00 00 01 02 03 04 .:1e05 05 06 07 08 09 .:1e0a 0a 0b 0c 0d 0e .:1e0f 0f 10 11 12 14 .:1e14 13 15 16 17 19 .:1e19 18 1a 20 20 20 .:1e1e 30 31 32 33 34 .:1e23 35 36 37 38 39 .:1e28 30 20 20 20 21 .:1e2d 23 24 25 1e 26 .:1e32 2a 28 29 2d 3d .:1e37 1b 1d 20 20 20 .:1e3c 20 20 20 20 20 . --------------------------------------------------------------------------------------------------- 29.05.2026