Skip to content

Instantly share code, notes, and snippets.

💭
💾

Fırat Salgür neuro-sys

💭
💾
Block or report user

Report or block neuro-sys

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View textmode.asm
; nasm mode13.asm -fbin -omode13.com
SECTION .text
org 100h
start: mov dx, filenamez
mov al, 0
call openfile
jnc fileopened
mov dx, filenotopeneds
call printstr
jmp filedone
View mode13.asm
start: call mode13 ; Set mode 13
repeat_row: mov ax, [posx]
cmp ax, 320 ; Check if posx >= 320
jz end_xloop ; Stop
mov al, [color]
mov cx, [posx]
mov dx, [posy]
call setpixel ; Set pixel at posx, posy with color
inc byte [color] ; color += 1
@neuro-sys
neuro-sys / spider.bas
Last active Mar 2, 2019
spiderweb basic
View spider.bas
10 mode 1
15 midx=320:midy=200:s=10
20 for x=0 to midy step s
30 move midx+x, midy
40 draw midx, midy+(midy-x)
50 draw midx-x, midy
60 draw midx, midy-(midy-x)
70 draw midx+x, midy
80 next
View rdaily-20190211-hard.asm
BDOS EQU &5
C_WRITESTR EQU &9
; Structs and the member sizes
edge_status equ 1 ; 0 negative, 1 positive
edge_node equ 2 ; pointer to node this edge connects to
edge_next equ 2 ; pointer to next edge
edge_s_offset equ edge_status + edge_node + edge_next
View rdaily-20190211-int.asm
; This challenge is about a simple card flipping solitaire game. You're
; presented with a sequence of cards, some face up, some face down. You
; can remove any face up card, but you must then flip the adjacent cards
; (if any). The goal is to successfully remove every card. Making the
; wrong move can get you stuck.
;
; In this challenge, a 1 signifies a face up card and a 0 signifies a
; face down card. We will also use zero-based indexing, starting from
; the left, to indicate specific cards. So, to illustrate a game,
; consider this starting card set.
View rdaily-20190211-easy.asm
; Description
; A number is input in computer then a new no should get
; printed by adding one to each of its digit. If you encounter a 9,
; insert a 10 (don't carry over, just shift things around).
;
; For example, 998 becomes 10109.
;
; Bonus
; This challenge is trivial to do if you map it to a string to
; iterate over the input, operate, and then cast it back. Instead, try
View euler-2.asm
; Each new term in the Fibonacci sequence is generated by adding the
; previous two terms. By starting with 1 and 2, the first 10 terms
; will be:
; 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
; By considering the terms in the Fibonacci sequence whose values do
; not exceed four million, find the sum of the even-valued terms.
ORG &8000
DI
@neuro-sys
neuro-sys / euler-1.asm
Last active Feb 24, 2019
Project Euler #1
View euler-1.asm
; If we list all the natural numbers below 10 that
; are multiples of 3 or 5, we get 3, 5, 6 and
; 9. The sum of these multiples is 23. Find the
; sum of all the multiples of 3 or 5 below 1000.
ORG &8000
RUN &8000,break
DI
LD DE, 999 ; COUNT INTEGERS BELOW 1000
View sprite.asm
org &4000
run &4000
di
im 1
; set ei, ret to &38 interrupt
ld a, &fb
ld (&38), a
ld a, &c9
@neuro-sys
neuro-sys / crtc.c
Created Jan 29, 2019
Amstrad CPC, CRTC Address Generator
View crtc.c
#include <stdio.h>
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
#define VIDEO_ADDR(MA, RA) \
((MA & 0x3FF) << 1) | ((RA & 7) << 11) | ((MA & 0x3000) << 2)
#define PRINT_CHAR_ADDR
You can’t perform that action at this time.