Change STOP byte count to 1
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 42/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Área
- documentation
Línea de trabajo
Localiza la entrada del opcode STOP en el repositorio e inspecciona cómo se representan los recuentos de bytes y M-cycle. Usa el comportamiento de STOP y wakeup indicado en el issue y, a continuación, elige y aplica una de las dos resoluciones mencionadas; se considera terminado cuando la entrada refleja ese comportamiento de forma coherente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
It doesn't make sense to have a 2-byte instruction which takes 1 M-cycle, as that's impossible to actually achieve on the CPU in any way (yes, that even includes ADD HL, r16, as it does ALU operation on both M-cycles, lower half first, then upper half in the second cycle).
There are two ways to solve this issue:
- make it 1B 1M, as that's what it actually is
- keep it as 2B, but make it 32769M (execution of STOP takes a single M-cycle, and wakeup from STOP mode fetches the next instruction on the 32768th cycle)
And yes, STOP is actually a single byte opcode, which can be observed when STOP fails to stop due to a button being held.
The short explaination of why STOP consumes two bytes can be summarized in these points:
- PC is always one byte ahead of the currently executed instruction
- if STOP enters stop mode, it fetches the next opcode, incrementing PC (PC points to STOP +2)
- the fetched opcode is discarded, and replaced with NOP
- on wakeup, the NOP fetches the instruction at STOP +2, and executes it in the next cycle
More details can be found here.
The reason HALT does not consume two bytes is because PC is not incremented when HALT fetches the next opcode, but otherwise works similar to STOP. More details here.
- Lenguaje dominante
- SCSS
- Estrellas
- 29
- Forks
- 10
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de gbdev/gb-opcodes
-
Add READMEAbierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 62/100
gbdev/gb-opcodes#33 · 1 reacción ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 48/100
gbdev/gb-opcodes#39 · 1 comentario ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
gbdev/gb-opcodes#27 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
gbdev/gb-opcodes#24 · 1 reacción ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
gbdev/gb-opcodes#22 ·
Todos los issues de gbdev/gb-opcodes
Issues similares
-
content triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
EESSI/docs#949 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
b4b docs-loc:codebase docs:minor-content-fix documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
graph-2026-11-simplify
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
sequant-io/sequant#1650 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100