РосСценНадзор рекомендует

РосСценНадзор рекомендует
РосСценНадзор рекомендует
РосСценНадзор рекомендует
Título: РосСценНадзор рекомендует
Autor: nodeus
Formato: Estándar 6912
Paleta: sRGB
Parte: DiHalt 2022 (1, En tiempo real gráficos)
Año: 2022
Nombre de archivo original: РосСценНадзор рекомендует.scr
Descargar nodeus+-+%D0%A0%D0%BE%D1%81%D0%A1%D1%86%D0%B5%D0%BD%D0%9D%D0%B0%D0%B4%D0%B7%D0%BE%D1%80+%D1%80%D0%B5%D0%BA%D0%BE%D0%BC%D0%B5%D0%BD%D0%B4%D1%83%D0%B5%D1%82+%282022%29+%28DiHalt+2022%2C+1%29.scrArchivo Original
DescargarDescargar para PC 2X 3X 4X
DescargarDescargar para imprimir (A4 300ppp)
Etiquetas: Blanco&Negro, Chip, Humor, Lupa, Ojo, Puño, Texto
Clasificación:
4.23
Vistas: 63
Añadido por: nodeus, 09.01.2022 14:10
Apass 19.01.2022 12:18
The image is very well done, however I have a gripe with the code snippet :P.
<joke>
I see 2 possibilities - 1) the code performs what it was intended to do but then is inefficient or 2) the code has a bug, and could be re-written in a simpler fashion.
First - the code copies in RAM at consecutive addresses the value of the accumulator, however, the accumulator is copied from the same memory location as DE is not incremented.
So the code can be simplified as:
PUSH HL
LD B, 4
LD DE, CODE
LD HL, #FE00
LD A,(DE)
LOAD LD (HL), A
INC HL
DJNZ LOAD
Note the position of the LOAD label. The only thing that this code does extra is wasting some time (7T states which is not easily replaced by NOPs)

Second - the code forgot to increment DE:
PUSH HL 11T states
LD B, 4 7T states
LD DE, CODE 10T states
LD HL, #FE00 10T states
LOAD LD A,(DE) 7T states
LD (HL), A 7T states
INC HL 6T states
INC DE 6T states
DJNZ LOAD 13/8T states
In this case, the code execution lasts 11 + 7 + 10 + 10 + 4 x (7 + 7 + 6 + 6) + 3 x 13 + 8 = 189T states.
If the code is re-written as:
PUSH HL 11T states
LD BC, 4 10T states
LD DE, #FE00 10T states
LD HL, CODE 10T states
LDIR 21/16T states
In this case, the code execution lasts 11 + 10 + 10 + 10 + 3 x 21 + 16 = 120T States
Or even quicker (with the observation that BC pair is not preserved)
PUSH HL 11T states
LD DE, #FE00 10T states
LD HL, CODE 10T states
LDI 16T states
LDI 16T states
LDI 16T states
LDI 16T states
This lasts 11 + 10 + 10 + 4 x 16 = 95T states (half of the initial variant)
</joke>

Finally, given the code snippet, I don't understand why the Z80 is dizzy?
If the code would have ended with:
DI
HALT
... On a Speccy... that would indeed make the CPU dizzy.
And it would have been quite a pun for the demoparty...

VBI 20.01.2022 01:01
pop hl, dude :))
Apass 07.02.2022 22:32
ORG #FFEF
PUSH HL
LD BC, #BFFA
LD HL, #4000
LD DE, #4001
LD (HL), #FF
LDIR
DI
HALT
POP HL

There, I fixed it!
I popped HL... to no avail...

Añadir nuevo comentario

Por favor, realice un rápido registro antes de dejar un comentario

Votos de la historia

Nick Votos Fecha
moroz1999 4 12.01.2023 22:55
: AL/M ; 4 22.06.2022 00:04
Beaver 5 27.02.2022 01:11
VBI 5 20.01.2022 01:01
tiboh 4 19.01.2022 18:45
scalesmann 4 18.01.2022 18:09
Dimidrol 4 16.01.2022 10:01
aGGreSSor 5 09.01.2022 22:51
pixelrat 5 09.01.2022 20:23
4ept 5 09.01.2022 18:14
Grongy 5 09.01.2022 15:14
Art-top 5 09.01.2022 14:45

Foto de las vistas de los últimos 90 días.