Jump to content



Recommended Posts

3 hours ago, GDMike said:

The code


I took liberties with your code |:) 

  • Preserved R1 by using R0 for the second color (BG) rather than copying it to R4
  • Changed your second use of R1 to use R0
  • Presuming that T1 starts on an even address, “MOV  T1,R1” and “MOV  T2,R1” both copy the same 2 bytes, viz., ‘F5’. It needs to be MOVB
  • Additional changes explained in the code that follows in the spoiler: 

T1     TEXT 'F'
T2     TEXT '5'
* get FG nybble into MSB of R1
       CLR  R1             for FG nybble
ST2    MOVB @T1,R1
       AI   R1,->3000      convert ASCII in MSB to number (if 0-9)
       CI   R1,>0A00       hex digit > 9?
       JLT  NEXT2          no..we're good
       AI   R1,->0700      correct to hex A-F
NEXT2  SLA  R1,4           shift to FG nybble
* get BG nybble into MSB of R0
       CLR  R0             for BG nybble
       MOVB @T2,R0
       AI   R0,->3000      convert ASCII in MSB to number (if 0-9)
       CI   R0,>0A00       hex digit > 9?
       JLT  NEXT4          no..we're good
       AI   R0,->0700      correct to hex A-F
* prepare for VWTR
NEXT4  A    R1,R0          add FG nybble to BG nybble
       AI   R0,>0007       we're updating VR07
       SWPB R0             VDP register # to MSB and FG+BG to LSB
       LIMI 0
       JMP  ST2            ????




  • Like 1
Link to comment
Share on other sites

Take care:


T1 TEXT '5'
   MOV @T2,R1

This will fill R1 with '5F'. With MOV, only word addresses (even) can be used; the 2^0 bit (A15) is ignored. You'd get the same result with MOV @T1,R1. 


Edit: Wow, that was really synchronous with Lee...

Edited by mizapf
Again, blank lines in the code.
  • Thanks 1
Link to comment
Share on other sites

Thx Lee, I was going to pull the file from last year but I got too busy today with yardwork hitting me. 

The code at the bottom,

JMP  ST2            ????

Was so I could repeat the process in explorer.

Thank you for clearing this up for us, I'm hoping to get started on the PAB next.

Thank you everyone. 

Edited by GDMike
Link to comment
Share on other sites

I ran that code in explorer and I did not get my final result of >F5 being deposited into R0 or any register.

So I played with the code and got the "0F" and "05" formulated with what Lee produced earlier, and I deposited those two bytes into R5 as pictured.

I just now need to get them combined into a register as "F5" ?



Edited by GDMike
Link to comment
Share on other sites

A little ahead of schedule..I gave myself until the weekend to complete this task.

Now to start reading up on PAB settings for disk reading/writing. I'm ready to do this since my command line is now set to interpret my commands against my library of predefined statements.


Edited by GDMike
  • Like 1
Link to comment
Share on other sites

2 hours ago, mizapf said:

If the FG color is in R0, and the BG color is in R1 (both in the high byte), you can OR R0 on R1 after shifting.

SLA R0,4


It is interesting to note that the execution times for your SOC suggestion and my A suggestion are identical and, fortunately, in this particular case, produce the same results:

       SOC  R1,R0    <---14 clock cycles  + 4 memory accesses
*  -or-
       A    R1,R0    <---14 clock cycles  + 4 memory accesses



  • Like 2
Link to comment
Share on other sites

The command line allows the user to customize the variant of screen/char colors because I didnt want a hot key to do it and

along with other features including copying, deleting pages AND reading, writing pages as a file..I hope anyway as that's the next step.


  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...