Login
Back to forumSee the full topicGo to last reply

Posted By

Litwr
on 2013-08-02
13:13:58
 Re: Z80 GUI: SymbOS

Hi, JamesD. Thank you very much for your information. However I have the intention to discover truth! happy I like any CPU so I have to know all about them. happy I really want to find more data about speed comparison. Sorry I am only skilled with 6502 and i80x86 assemblers. My dream is to find true speed relationship between 6502, z80, and K1801VM1 (it used at first SU home PC https://en.wikipedia.org/wiki/Electronika_BK). I've just made two algorithms for 6502:


  1. general addition and assignment of n-byte numbers (n - constant, n < 256), it realizes v3 := v1 + v2 assignment operator;
  2. the comparison of two n-byte zero-terminated strings (n - variable, any value in range 0..65535).


Algorithm1



the callcyclesbytes
lda #>v122
sta bigadd.arg1 + 244
lda #<v122
sta bigadd.arg1 + 144
lda #>v222
sta bigadd.arg2 + 244
lda #<v222
sta bigadd.arg2 + 144
lda #>v322
sta bigadd.arg3 + 244
lda #<v322
sta bigadd.arg3 + 144
jsr bigadd63
4239



the subroutinecyclesbytes
bigaddclc21
ldx #022
bigadd.arg1lda 0,x43
bigadd.arg2adc 0,x43
bigadd.arg3sta 0,x53
inx21
cpx #n22
bne bigadd.arg13/22
rts61
20n+918



Algorithm2 (edited)



the callcyclesbytes
lda #>s122
sta strcmp.arg1 + 244
lda #<s122
sta strcmp.arg1 + 144
lda #>s222
sta strcmp.arg2 + 244
lda #<s222
sta strcmp.arg2 + 144
jsr strcmp63
3027



the subroutinecyclesbytes
strcmpldx #022
strcmp.arg1lda 0,x43
strcmp.arg2cmp 0,x43
bne l22/32
cmp #022
beq l22/32
inx21
bne strcmp.arg13/22
inc strcmp.arg1 + 253
inc strcmp.arg2 + 253
bne strcmp.arg132
l2rts61
19n+4 if s1=s228
19(n+1) if s1≠s2 but first n chars are matched



Could anybody provide codes or links to the functionally equivalent codes for z80? I'm ready to calculate cycles and bytes by myself. wink Thanks in advance.

[**edit**] I've just find code for the strings comparison at http://sources.cosam.org/cgi-bin/viewvc.cgi/z80/string.s?view=markup - it gives for the subroutine 57n+50 cycles and 14 bytes, for the call 37 cycles and 9 bytes. So z80 exactly 3 times slower here but the code for it is about 3 times shorter. So we need at least 256K for C+4's SymbOS but it should be at least 50% faster than at CPC!



Back to top


Copyright © Plus/4 World Team, 2001-2024