Post Reply 
Service module (SM1C) and peripherial flags
05-27-2024, 10:39 AM
Post: #3
RE: Service module (SM1C) and peripherial flags
(05-27-2024 09:41 AM)teenix Wrote:  Is C used further on in the code?

Initially it is set to FFFF0000FFF000, but at 4633 is cleared to 00000000000000.

cheers

Tony

Hi Tony,

Well, at 4633 only the most significant nibble is cleared, ie. C = 0FFF0000FFF000.
After that PRPHSLCT is called, and C[XS] is incremented, both uses only the last 3 last nibbles.
RAMSLCT would then select RAM at 0x0100, and we write 0x0FFF0000FFF100 to the register at 0x100, clear the C register and read it back to verify if 0x100 exists in the address space (first register in memory module 1 (in a 41C)).

But, I have not looked much at the code yet, but seems like it tries to see what memory is available, but the actual value in C is not used (only last 3 nibbles to point at the wanted reg address).

Cheers,
Thomas


Code:
 4633 05E          C=0    MS     ; C = 0FFF0000FFF000
 4634 3F0          PRPHSLCT      ; Deselect any peripherial
 4635 236          C=C+1    XS   ; C = 0FFF0000FFF100
 4636 0A0          SLCTP
 4637 3DC          R=R+1
 4638 10E          A=C    ALL    ; A = 0FFF0000FFF100
 4639 270          RAMSLCT       ; Select register address 0x100
 463A 2F0          WRITDATA      ; Write C to register at 0x100
 463B 04E          C=0    ALL    ; Clear register C
 463C 038          READDATA      ; Read back from 0x100
 463D 36E          ?A#C    ALL   ; Still same value?
 463E 02B          JNC    +5 4643 ; Jump to 4643 if equal (memory exists)
 463F 17E          A=A+1    MS   ; Increment A[MS] ( A = 0FFF0000FFF200)
 4640 0AE          A<>C    ALL   ; Restore C
 4641 10E          A=C    ALL  
 4642 022          B=0    @R

 4643 0E0          SLCTQ
 4644 31C          R=    1
 4645 130140       LDIS&X    140
 4647 20A          C=C+A    R<   ; Ram-addr += 0x140
 4648 373          JNC    -18 4636  ; Try again ...
 4649 0A0          SLCTP
 464A 309118       ?NCXQ    46C2
 464C 05E          C=0    MS
 464D 23E          C=C+1    MS
 464E 37E          ?A#C    MS
 464F 0FF          JC    +31 466E
 4650 05C          R=    4
 4651 052          C=0    P-Q
 4652 272          C=C-1    P-Q
 4653 0F2          B<>C    P-Q
 4654 18C          ?FSET    11
 4655 0CF          JC    +25 466E
 4656 14D11C       ?NCXQ    4753
 4658 328          WRIT    12
 4659 328          WRIT    12
 465A 09D11C       ?NCXQ    4727
 465C 013          JNC    +2 465E
 465D 014          ?R=    3
 465E 012          A=0    P-Q
 465F 00F          JC    +1 4660
 4660 010          LD@R    0
 4661 120          ?P=Q
 4662 24111C       ?NCXQ    4790
 4664 3CC          ?KEY
 4665 1DD103       ?CGO    4077
 4667 18C          ?FSET    11
 4668 027          JC    +4 466C
 4669 2CC          ?FSET    13
 466A 3ED117       ?CGO    45FB
 466C 201102       ?NCGO    4080
 466E 2DC          R=    13
 466F 188          SETF    11
 4670 290          LD@R    A
 4671 235118       ?NCXQ    468D
 4673 0C6          C=B    S&X
 4674 0F10F2       ?NCGO    3C3C
 4676 0F3          JNC    +30 4694

[35/45/55/65/67/97/80 21/25/29C 31E/32E/33E|C/34C/38E 41C|CV|CX 71B 10C/11C/12C/15C|CE/16C 32S|SII/42S 28C|S 48GX/49G/50G 35S 41X]
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Service module (SM1C) and peripherial flags - ThomasF - 05-27-2024 10:39 AM



User(s) browsing this thread: 1 Guest(s)