CMOS in SMUC
ZXNet echo conference «code.zx»
From Aleksandr Majorov → To Dmitry Lomov 8 September 1998
Hayushki, Dmitry!
08-09-98 at 04:16 someone Dmitry Lomov wrote 2 All on the topic 'CMOS in
SMUC'.
DL> Would the respected ALL tell me the port addresses in the subject and
DL> ways to access them?
best to climb through RST #08, brakes only...
anyway, here you go, catch it
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
89h (R8time) - read/write time from
CMOS (RST 8: DB #89).
In register D the bits set:
7 - (1) write down the time/date value
(0) read the time/date value.
6 - (1) read into buffer (only if
bit 7=0. (see bit 5).
5 - (1) direct read (6 bytes of data
from CMOS).
(0) read in ASCII format.
0 - (1) work with date
(0) work with time.
In addition, in HL - the buffer address (if you count
tapping occurs in the buffer), at 5 and 2
CPU banks. Register E contains the format
reading: low-order 5 bits - symbol
divider (+32!!!) (VS: for example for sym-
ox ":" should be 26), bits 7,6 and 5
allow clock output accordingly,
minutes and seconds, or to display the date:
bit 7 - output day of the week
bit 6 - put "0" in front of the number
bit 5 - display the month as a word and before
add "19" for the year.
The function returns data either to a buffer,
(as an ASCII string or 6 bytes:
seconds, minutes, hours, date, month,
year), or in registers:
C - seconds/date
B - minutes/month
E - hours/yearL - day of the week
Values are set in these registers
to change the time/date.
out: CY=error (no CMOS chip).
VS: MOA succinctly noted that the data
can be returned to the buffer (in ASC format.)
But if you do this, you will notice
that you always come back alone and
same meanings! In fact, time in
ASCII is stored somewhere in the 8th bank,
from where it is returned to you. And updating
Only available when Reset is initialized or
Magic!!! I learned how to bypass this feature
thus: first time is called
in registers (at this moment the data in
buffer are also updated), after which
I’m putting my time back into my buffer. And for this
since this is true time. (Exactly like this
This is how I poll the time in BBS 3.20).
Thus, the challenge of time occurs
dit in 2 passes: first to registers
(via RST 8), then directly to the buffer
(again via RST 8). For this MOA you need
hit you over the head too ;)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
and here is the direct crawl:
; ***proc
; parm: ---
; value : cf==busy
; nc==read, hl=&bf[6]
; modify: af bc de hl
_rtc_try_read
ld de, #3FF3 ;in
ld bc, #3FF0 ;out
ld (rtc_tryrd_sp+1), sp
ld hl, rtc_tryrd_fin
push hl
push de
push bc
ld hl, rtc_tryrd_inc
push hl
push de
push bc
push hlpush de
push bc
push hl
push de
push bc
ld hl, rtc_tryrd_add2
push hl
push de
push bc
push hl
push de
push bc
push hl
push de
push bc
ld hl, rtc_tryrd_tst
push hl
push de
push bc
ld a, #0A
ld hl, rtc_tryrd_bf
ld e, 0
ld bc, #DFBA
di
jp #3D30
rtc_tryrd_bf ds 7
rtc_tryrd_tst
add a, a
ld a, e
jp nc, #3D30
ei
rtc_tryrd_sp ld sp, 0
ret
rtc_tryrd_fin ei
ld (hl), a
ret
rtc_tryrd_add2 ld (hl), a
inc hl
ld a, 2
add a, e
ld e, a
jp #3D30
rtc_tryrd_inc ld (hl), a
inc hl
inc e
ld a, e
jp #3D30
; *** end proc
Hу вот и все *MAS* с кувалдой
P.S. какое счастье что я перед уходом на работу
прочитал это письмо! Ты же не думаешь что мой архив
со всяким мусором на работе храниться? ;-)))))
From Aleksandr Majorov → To Dmitry Lomov 12 September 1998
Hayushki, Dmitry!
Once in morning 12-09-98 02:29:00 somebody Dmitry Lomov has
written to Aleksandr Majorov about 'CMOS in SMUC'.
[ ]
AM>> If you really need it, I can trace the process over the weekend
AM>> records in kmos and report...
DL> haaachu! I have an idea - to make a device, I’m thinking about how to connect the clock there.
This means that experiments on live emulators have shown... ;-)
So this means:
7th bit #FFBA = 0
#DFBA record - register selection,
read - register contents
7th bit #FFBA = 1
#DFBA write - write to a register register,
reading - not used!
Now the jokes:
before _each_ IN (C) or OUT (C) command is executed
this is the rulez:
LD B,20
DJNZ$
i.e. the delay is somewhere around 260...280 cycles!!!
Next - whoever read the document on SMAK knows what to choose
IBM peripheral port address bits A8 A9 are set
through 2 and 3 bits #FFBA.
And now the joke is _any_ reference to the clock (and I suspect
as for the screw!) changes the contents of this register completely!
The funny thing is that this port is read-only!
And in the 8th bank at address #DFF0 a copy of the latter is stored
output to this port.
And by default #77 is issued to this port, i.e. access
to COM1 (#03F8).
So, a phrase from the SMAK book
"The controller decoding scheme allows you to choose any
I/O port on the IBM PC XT peripheral board,connected to SMUC"
not entirely true...
If you select, for example, COM2, then any shadow call
with some degree of probability will switch SMAK
back to COM1...
ATTENTION!!!
This is true for the Scorp emulator!!!
I do not guarantee that _all_ of the above
(except for port addresses) matches
reality!!!
Well that's it *MAS* with a sledgehammer
From Dmitry Lomov → To Michael Kondratyev 13 September 1998
Hi Michael!
DL>> as I understand it, there is one port #DFBA, addressed in tr-dos
DL>> writing there is the register number, reading is its contents.
DL>> correct? - then what about writing to registers?
MK> this is the same, only with a different high bit in 0xffba.
So, did I understand correctly:
(all through trdos...)
READ OUT (#FFBA),%01110001
OUT (#DFBA),REG_NUMBER
IN A,(#DFBA); contents
WRITE OUT (#FFBA),%01110001
OUT (#DFBA),REG_NUMBER
OUT (#FFBA),%11110001
OUT (#DFBA),NEW_REG_DATA
All the best.
Dmitry aka -=LD=- / X-TRADE GROUP.
From Valerij Kozhevnikov → To Dmitry Lomov 14 September 1998
Hello Dmitry! Quoting your msg of [hamster chew] to All:
DL> Wouldn't dear ALL tell me the port addresses in the subject and
DL> ways to access them?
But here there is a little.
Access to the CMOS clock chip in the SMUC controller.
#DFBA - address/data register
#FFBA bit7 - recording resolution, mask #77.
_In the TR-DOS input/output space!_
To read from the register:
- write the number of the required register to port #DFBA;
- read the meaning from it.
To write to the register:
- write the number of the required register to port #DFBA;
- allow writing to the microcircuit registers, for this
set bit 7 in port #FFBA (mask #77), for example like this:
LD A,#77
SET 7,A
LD BC,#FFBA
OUT(C),A
- write the new register value to port #DFBA.
- disable writing to the microcircuit registers, to do this write
number #77 in port #FFBA.
Addresses of procedures in trdos ROM:
#3FF0 OUT (C),A
RET
#3FF3 IN A,(C)
RET
!NB:
Climbing in the so-called "general purpose lake" - to the garden!
This is where the shadow guy likes to stuff his bullshit.
And this is how the shadow man himself does it. Throw everything here
broke in By the way, the brakes there are a huge bucket.
;read register.
;in :B - register
;out:A - value
RCMOS PUSH BC
PUSH BC
L1F5B LD BC,#FFBA
LD A,(LDFF0)
AND #7FLD (LDFF0),A
CALL P_OUT
POP AF
LD B,#DF
CALL P_OUT
LD B,#DF
CALL P__IN
POP BC
RET
;write register .
;in: B - p
; A - snowflake
WCMOS PUSH BC
PUSH AF
PUSH BC
LD BC,#FFBA
LD A,(LDFF0)
AND #7F
CALL P_OUT
POP AF
LD B,#DF
CALL P_OUT
LD B,#FF
LD A,(LDFF0)
OR #8
CALL P_OUT
POP AF
LD B,#DF
CALL P_OUT
LD B,#FF
LD A,(LDFF0)
AND #7F
LD (LDFF0),A
CALL P_OUT
POP BC
RET
P_OUT CALL PAUSE
OUT (C),A
RET
P__IN CALL PAUSE
IN A,(C)
RET
PAUSE PUSH BC
LD B,#14
L201F DJNZ L201F
POP BC
RET
LDFF0 DEFB #77;
ps Subjects to video uploads in this category:
=== Cut ===
РЕГИСТР А (review)
────────────────────────────
7 UIP "1" on the back of the phone, yes
See more photos and часа-
ми pаботать нельзя, нyжно подождать
некотоpое вpемя.
=== Cut ===
WBR, Jason.