-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 89107d6
Showing
49 changed files
with
13,155 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Proyectos de Assembler de la Universidad de San Carlos de Guatemala | ||
|
||
Estos son alguno de los proyectos que realice durante mi licenciatura en la Facultad de ingeniería de la Universidad de San Carlos de Guatemala. | ||
|
||
Hice mi mejor esfuerzo por documentarlos con la premura de tiempo entre mis cursos. Su hubiera alguna duda y aun recuerdo como se hacia, puedo ayudarte. | ||
|
||
# Requesitos de Software | ||
Se uso `NASM` para compilar el codigo y `DOSBOX` para poder ejecutar los programas en Windows 10. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
; UNIVERSIDAD DE SAN CARLOS DE GUATEMALA | ||
; FACULTAD DE INGENIERIA | ||
; ARQUITECTURA DE COMPUTADORES Y ENSAMBLADORES 1 | ||
; PRIMER SEMESTRE | ||
; SECCION B | ||
; HERBERTH GUILLERMO OBREGÓNN ESPINO - 201314237 | ||
; NASM | ||
; | ||
; Comando para ensamblar: #nasm fruta.asm -o fruta.com | ||
; Presionar tecla para finalizar | ||
;======================================================================| | ||
; M A I N | | ||
;======================================================================| | ||
|
||
ORG 100h | ||
|
||
mov ah,00h ;modo video | ||
mov al,13h ;320x200 256 colores | ||
int 10h ;servicio de pantalla | ||
call Put_Fruit ;pintar ejes | ||
call GetCh2 ;leer caracter | ||
|
||
mov ah,00h ;modo video | ||
mov al,03h ;80x25 16 colores | ||
int 10h ;servicio de pantalla | ||
|
||
mov ah, 4ch ; funcion 4C, finalizar ejecucion | ||
int 21h ; interrupcion DOS | ||
|
||
;====================================================================== | ||
; funcion Put_Fruit | ||
; coloca la fruta | ||
|
||
Put_Fruit: | ||
mov es, word[startaddr] ;colocar direccion de segmento de video en ES | ||
|
||
;f(158,98) = x + y*320 | ||
mov di, 31360 ;y*320 = 98*320 = 31360 | ||
add di, 158 ;sumar x | ||
|
||
mov si, fruta1 ;colocar direccion de dato source | ||
mov cx, 5 ;tamaño del dato a mover | ||
cld ;clear direction flag (direccion en que se copian los datos) | ||
rep movsb ;mover dato | ||
|
||
mov si, fruta2 ;colocar direccion de dato source | ||
add di, 315 ;cambiar de fila | ||
mov cx, 5 ;tamaño del dato a mover | ||
cld ;clear direction flag (direccion en que se copian los datos) | ||
rep movsb ;mover dato | ||
|
||
mov si, fruta3 ;colocar direccion de dato source | ||
add di, 315 ;cambiar de fila | ||
mov cx, 5 ;tamaño del dato a mover | ||
cld ;clear direction flag (direccion en que se copian los datos) | ||
rep movsb ;mover dato | ||
|
||
mov si, fruta4 ;colocar direccion de dato source | ||
add di, 315 ;cambiar de fila | ||
mov cx, 5 ;tamaño del dato a mover | ||
cld ;clear direction flag (direccion en que se copian los datos) | ||
rep movsb ;mover dato | ||
|
||
mov si, fruta5 ;colocar direccion de dato source | ||
add di, 315 ;cambiar de fila | ||
mov cx, 5 ;tamaño del dato a mover | ||
cld ;clear direction flag (direccion en que se copian los datos) | ||
rep movsb ;mover dato | ||
|
||
ret | ||
;====================================================================== | ||
; funcion GetCh2 | ||
; ascii tecla presionada | ||
|
||
GetCh2: | ||
mov ah,08h ; funcion 8, capturar caracter sin mostrarlo | ||
int 21h ; interrupcion DOS | ||
ret ; return | ||
|
||
;======================================================================| | ||
; D A T A | | ||
;======================================================================| | ||
|
||
SEGMENT data | ||
startaddr dw 0A000h ;inicio del segmento de memoria de video | ||
|
||
;fruta | ||
fruta1 DB 00, 00, 10, 00, 00 | ||
fruta2 DB 00, 04, 04, 04, 00 | ||
fruta3 DB 04, 04, 04, 04, 04 | ||
fruta4 DB 00, 04, 04, 04, 00 | ||
fruta5 DB 00, 00, 04, 00, 00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
; HERBERTH GUILLERMO OBREGÓNN ESPINO - 201314237 | ||
|
||
ORG 100h | ||
|
||
mov dx, menu ; coloar direccion de cadena en | ||
mov ah,9 ; funcion 9, imprimir en pantalla | ||
int 21h ; interrupcion DOS | ||
|
||
mov ah,4ch ; funcion 4c finalizar ejecucion | ||
int 21h ; interrupcion DOS | ||
|
||
menu db "hola mundo!",13,10,'$' | ||
|
||
|
||
; call <PROC> | ||
IF: | ||
mov ax, 01h ; asignar 1 al registro AX | ||
|
||
cmp ax, 02h ; comparar el registro AX con 02h | ||
je Es_1 ; si es igual saltar (jump equal) | ||
jne No_es_2 ; si no es igual saltar (jump non equal) | ||
|
||
Es_2: | ||
jmp Siguiente | ||
|
||
No_es_2: | ||
jmp Siguiente | ||
|
||
Siguiente: | ||
ret | ||
ret | ||
|
||
|
||
SWITCH: | ||
mov ax, 01h ; asignar 1 al registro AX | ||
cmp ax, 01h ; comparar el registro AX con 02h | ||
je Op1 ; Saltar a Op1 | ||
|
||
cmp ax, 02h ; comparar el registro AX con 02h | ||
je Op2 ; Saltar a Op1 | ||
|
||
Op1: | ||
jmp Fin | ||
|
||
Op2: | ||
jmp Fin | ||
|
||
Fin: | ||
ret | ||
ret | ||
|
||
FOR: | ||
mov cx, 10h ; Se inicia el contador CX en 10 | ||
|
||
Cfor: | ||
ret | ||
loop Cfor ; dECREMENTA cx y salta a la etq hasta llegar a 0 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
section .data | ||
holaStr: db 'Hola Mundo!',10 ; sección de datos del programa | ||
holaSize: equ $-holaStr | ||
|
||
section .text | ||
global _start | ||
|
||
_start: | ||
mov eax,4 ; llamada del sistema 'write' identificador 4 | ||
mov ebx,1 ; descriptor de archivo 1 = pantalla | ||
mov ecx,holaStr ; cadena a mostrar | ||
mov edx,holaSize ; longitud de la cadena | ||
int 80h ; invocar al kernel | ||
|
||
; Terminate program | ||
mov eax,1 ; llamada del sistema 'exit' | ||
mov ebx,0 ; codigo de error 0 | ||
int 80h ; invocar al kernel |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.