Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added changes as requested in the previous pull request #159

Open
wants to merge 99 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
890f007
utilize user-specific temp directories
schreiberx Nov 21, 2019
b47d9aa
Added GDB Debugging features
schreiberx Nov 26, 2019
aaa78ca
Added SASM verbose output for executed commands
schreiberx Nov 26, 2019
ea1a576
removed obsolete error msg
schreiberx Nov 26, 2019
3260d73
Merge remote-tracking branch 'orig-repo/master'
schreiberx Jan 18, 2021
4b5b7b8
updates REAME file
schreiberx Jan 18, 2021
84a152a
QT5
schreiberx Jan 21, 2021
ce5a485
Merge branch 'master' of https://github.com/schreiberx/SASM
schreiberx Jan 21, 2021
815f0d4
Creating new branch
ge69dal Feb 4, 2021
d0ee8b4
fixed deadlock in debugger
ge69dal Feb 4, 2021
bfd0b03
cleaned up obsolete header files
schreiberx Feb 4, 2021
4511767
Merge pull request #1 from schreiberx/SASMlorenz
schreiberx Feb 4, 2021
ffd9bc2
fixed deadlock for normal mode
ge69dal Feb 4, 2021
0059b02
fixed Bug for Normalmode
ge69dal Feb 5, 2021
526d9f3
removed \n for registerInfo and removed last changes for normalmode
ge69dal Feb 5, 2021
26e100b
fixed Compilingbug for Windows
ge69dal Feb 11, 2021
2c4188b
removed warnings
ge69dal Feb 11, 2021
1407e25
extended ReadMe
ge69dal Feb 11, 2021
31a9223
Merge pull request #2 from schreiberx/SASMlorenz
schreiberx Feb 11, 2021
4de83d0
Merge remote-tracking branch 'orig-repo/master'
schreiberx Feb 11, 2021
5af9700
updated README to markup
schreiberx Feb 11, 2021
60ffbf3
registerInfo fixed
ge69dal Feb 14, 2021
eac44a8
registerInfo fixed
ge69dal Feb 14, 2021
cd14fa3
registerInfo fixed
ge69dal Feb 14, 2021
d20ec4c
registerInfo fixed
ge69dal Feb 14, 2021
657b071
fixed Registers
ge69dal Feb 14, 2021
ce77f65
Merge remote-tracking branch 'orig-repo/master'
schreiberx Feb 15, 2021
e1ef22a
u
schreiberx Feb 15, 2021
4d98547
fixed Linefeedbug under windows
ge69dal Feb 15, 2021
3eca126
fix
ge69dal Feb 16, 2021
466f24c
fixed memoryInfo for windows
ge69dal Feb 16, 2021
42c0ade
Merge branch 'master' into SASMlorenz
ge69dal Feb 21, 2021
1c44e80
finished the merge
ge69dal Feb 23, 2021
0644f86
fixed merge
ge69dal Feb 23, 2021
6b4b9ee
fixed run
ge69dal Feb 23, 2021
43c76a0
addet AsyncMsg
ge69dal Feb 23, 2021
3e6aed5
fixed MemoryInfo in MiMode
ge69dal Feb 23, 2021
f75b5b6
debugger.cpp
ge69dal Feb 23, 2021
74bb5e4
removed warning
ge69dal Feb 23, 2021
a2594e2
Merge pull request #3 from schreiberx/SASMlorenz
schreiberx Feb 23, 2021
24cabc3
Added StackView
ge69dal Apr 13, 2021
da14313
updated StackView
ge69dal Apr 14, 2021
83f4f77
added signed Flag for Stack
ge69dal Apr 15, 2021
eef9943
fixed signedFlag
ge69dal Apr 16, 2021
bcbe84a
fixedStack for x86 Mode
ge69dal Apr 16, 2021
424e651
fixedStack for x86 Mode
ge69dal Apr 16, 2021
4effd68
fixedStack for x86 Mode
ge69dal Apr 16, 2021
32182f6
fixed address overflow
ge69dal Apr 16, 2021
69dfabb
added addresses for stackcontent
ge69dal Apr 22, 2021
d2ac446
first attemp for display under Linux
ge69dal May 6, 2021
d9f087b
added new displayWindow
ge69dal May 8, 2021
cf0210b
added Windows compile flag
ge69dal May 10, 2021
aa41d6c
added Windows compile flag
ge69dal May 10, 2021
ea89ba3
added Windows compile flag
ge69dal May 10, 2021
268fa65
added Windows compile flag
ge69dal May 10, 2021
94a8728
a
ge69dal May 10, 2021
86e7578
upgraded display
ge69dal May 21, 2021
6e79a4d
upgraded display
ge69dal May 21, 2021
01c9c2c
updated display
ge69dal May 22, 2021
e862d4d
fixed issues for the display
ge69dal May 24, 2021
7215b48
fixed display connect
ge69dal May 24, 2021
6c45300
fixed display issue
ge69dal May 25, 2021
71c0b65
fixed Windowsize
ge69dal May 31, 2021
abd1def
added fps settings
ge69dal Jun 17, 2021
463112a
display for Windows
ge69dal Jun 25, 2021
2d7f9e5
added display for Windows
ge69dal Jun 25, 2021
a0728fb
fixed scaling
ge69dal Jul 4, 2021
b3e23a2
added scrolls
ge69dal Jul 4, 2021
bd061a3
added scrollbars
ge69dal Jul 4, 2021
889fc57
added scrollbars
ge69dal Jul 4, 2021
43d1695
fixed linux bug
Jul 6, 2021
54ec1c6
text update
ge69dal Jul 6, 2021
fd58214
added shared memory
Jul 10, 2021
1ca501d
fix
Jul 11, 2021
5e6c874
fix
Jul 11, 2021
d917913
fix for Window
ge69dal Jul 14, 2021
3dd7ae5
added drawImage
ge69dal Jul 20, 2021
ee410b2
fixed fps
RealShuShei Sep 20, 2021
038ee47
added mimode enabled as default
RealShuShei Sep 21, 2021
a8ed54f
Merge pull request #4 from schreiberx/SASMlorenz
schreiberx Nov 4, 2021
385861c
updated README
schreiberx Nov 4, 2021
303b101
updated stack error
ge69dal Nov 6, 2021
732661d
mi-mode as default
ge69dal Nov 6, 2021
84a426e
added examples
ge69dal Nov 6, 2021
4847536
fix for the stack
ge69dal Nov 8, 2021
5448612
fix stack
ge69dal Nov 9, 2021
b03571d
removed wrong errorLog print
ge69dal Nov 9, 2021
1c7b82d
added examples
ge69dal Nov 9, 2021
c82af06
displayanimation added
ge69dal Nov 9, 2021
f5f8a1f
removed unused variables
schreiberx Nov 9, 2021
06622a0
disabled zoom during processing
ge69dal Nov 10, 2021
be4157f
disabled zoom during processing
ge69dal Nov 10, 2021
0e4076b
disabled zoom during processing
ge69dal Nov 10, 2021
689e603
fixed pause
ge69dal Nov 12, 2021
8bbb06e
updated "SASM Project" to "SASM"
schreiberx Nov 12, 2021
ccc8399
removed ui_settings.h
schreiberx Nov 12, 2021
9bca3c5
settings clean up
ge69dal Nov 12, 2021
0fb0ac3
change MI as default
ge69dal Nov 12, 2021
d5fa0a2
make displayWindow editable
ge69dal Nov 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ Thumbs.db
doc/*
.qmake.stash
sasm.app
ui_settings.h

*.swp
*.o
sasm
99 changes: 99 additions & 0 deletions Linux/share/sasm/NASM/macro.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,104 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <semaphore.h>
#include <sys/wait.h>
#include <sys/shm.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/types.h>
#include <string.h>
#include <sys/ipc.h>
#include <sys/sem.h>

#define SEM_PRODUCER_FNAME "/myproducer"
#define SEM_CONSUMER_FNAME "/myconsumer"
#define BLOCK_SIZE 3145728
#define FILENAME "/tmp"

FILE *get_stdin(void) { return stdin; }
FILE *get_stdout(void) { return stdout; }
void sasm_replace_stdin(void) {dup2(open("input.txt",0),0);}

int sem_consumer_id, sem_producer_id;
int display_size;
char is_setup = 0;
int shared_block_id;
char* shm_block;

void setup(int res_x, int res_y, char mode, char fps){
if(is_setup){
printf("already setup -> dont call twice\n");
fflush(stdin);
exit(-1);
}
is_setup = 1;

if(res_x < 100 || res_x > 1024 || res_y < 100 || res_y > 1024 || fps > 30 || fps < 1){
printf("sem_prod failed\n");
fflush(stdin);
exit(-1);
}

struct sembuf sb = {0, -1, 0};
sem_producer_id = semget(ftok(FILENAME, 'p'), 1, 0);
if(sem_producer_id == -1){
printf("sem_prod failed(%ld)(%ld)\n", ftok(FILENAME, 'p'), errno);
exit(-1);
}
sem_consumer_id = semget(ftok(FILENAME, 'c'), 1, 0);
if(sem_consumer_id == -1){
printf("sem_consumer failed\n");
exit(-1);
}
if (semop(sem_consumer_id, &sb, 1) == -1){ //sem_wait(sem_consumer);
perror("semop");
exit(1);
}
display_size = (mode) ? res_x*res_y*3 : res_x*res_y;

key_t key = ftok(FILENAME, 'f');
if(key < 0){
exit(-1);
}
shared_block_id = shmget(key, BLOCK_SIZE, 0666 | IPC_CREAT);
if(shared_block_id == -1){
exit(-1);
}
shm_block = shmat(shared_block_id, NULL, 0);
if(shm_block==(char*)-1){
exit(-1);
}
for(int i = 0; i < 4; i++){
shm_block[i] = (res_x >> (8*i)) & 0xff;
shm_block[i+4] = (res_y >> (8*i)) & 0xff;
}
shm_block[8] = mode;
shm_block[9] = fps;
sb.sem_op = 1; /* free resource sem_post(sem_producer); */
if (semop(sem_producer_id, &sb, 1) == -1) {
perror("semop");
exit(1);
}
}

void update(char* data){
if(!is_setup){
printf("please call setup before update");
fflush(stdin);
exit(-1);
}
struct sembuf sb = {0, -1, 0};
if(semop(sem_consumer_id, &sb, 1) == -1){ //sem_wait(sem_consumer);
perror("semop");
exit(1);
}
memcpy(shm_block, data, display_size);
sb.sem_op = 1; /* free resource sem_post(sem_producer); */
if (semop(sem_producer_id, &sb, 1) == -1) {
perror("semop");
exit(1);
}
}

void sleepFunc(){usleep(10000000);}
3 changes: 1 addition & 2 deletions Linux/share/sasm/Projects/NASMHello.asm
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ section .data
section .text
global CMAIN
CMAIN:
mov ebp, esp
mov ebp, esp; for correct debugging
PRINT_STRING msg
NEWLINE
xor eax, eax
ret
1 change: 0 additions & 1 deletion Linux/share/sasm/Projects/NASMHellox64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ section .text
CMAIN:
mov rbp, rsp
PRINT_STRING msg
NEWLINE
xor rax, rax
ret
251 changes: 251 additions & 0 deletions Linux/share/sasm/Projects/display_animation32.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
%include "io.inc"

section .data
displayArray: times 262144 db 0xff

section .text
global CMAIN
CMAIN:
mov ebp, esp
;eax = min 1 | ebx = max 510
setupDisplay 512, 512, 0, 30
call quadrat
call quadrat
ret

quadrat:
mov eax, 1
mov ebx, 510
mov ecx, 125
mov edx, 385

andi:
call clearDisplay

cmp eax, 205
jl erstesq
mov eax, 1
mov ebx, 510

erstesq:

push eax
push eax
push ebx
push eax
call bresenham
add esp, 16

push eax
push eax
push eax
push ebx
call bresenham
add esp, 16

push eax
push ebx
push ebx
push ebx
call bresenham
add esp, 16

push ebx
push eax
push ebx
push ebx
call bresenham
add esp, 16

;;;;
cmp ecx, 205
jl zweitesq
mov ecx, 1
mov edx, 510

zweitesq:

push ecx
push ecx
push edx
push ecx
call bresenham
add esp, 16

push ecx
push ecx
push ecx
push edx
call bresenham
add esp, 16

push ecx
push edx
push edx
push edx
call bresenham
add esp, 16

push edx
push ecx
push edx
push edx
call bresenham
add esp, 16
;;;;

inc eax
dec ebx
inc ecx
dec edx


updateDisplay displayArray
jmp andi
ret

bresenham:
;Parameter: esp-24: y-ende | esp-48: x-ende | esp-56: y-anfang | esp-64: x-anfang --> 24, 28, 32, 36 -> : esp+0
;eax = dx, ebx = dy, ecx = x, edx = y, edi = fehler, esp+0 singedflag for add
;---
;swap points if xstart > xend
push eax
push ebx
push ecx
push edx
push 1 ;r8 ersatz
mov eax, [esp+28]
mov ebx, [esp+36]
cmp eax, ebx
jge noswap
mov [esp+36], eax
mov [esp+28], ebx
mov eax, [esp+24]
mov ebx, [esp+32]
mov [esp+32], eax
mov [esp+24], ebx
noswap:
;---
;REM Initialisierungen
; dx*2; dy*2
; x = xstart
; y = ystart
; SETPIXEL x,y
; fehler = dx
;---
;Initialisierungen
;mov r8, 1
mov eax, [esp+28] ;anpassen
mov ebx, [esp+24]
sub eax, [esp+36]
sub ebx, [esp+32]
mov edi, [esp+36]
mov esi, [esp+32]
call setPixel
mov ecx, [esp+36]
mov edx, [esp+32]
shl eax, 1
shl ebx, 1
cmp ebx, 0
jge skip
mov edi, ebx
mov esi, 0
call absvalue
mov ebx, edi
push eax
mov eax, -1
mov [esp+4], eax
pop eax
skip:
mov edi, ebx
mov esi, 0
call absvalue
cmp edi, eax
jg teil2
;----teil1----
mov edi, eax
loop: cmp [esp+28], ecx
jle end
inc ecx
sub edi, ebx
cmp edi, 0
jge if
add edx, [esp]
add edi, eax
if: push edi
mov edi, ecx
mov esi, edx
call setPixel
pop edi
jmp loop
teil2: ;-------
mov edi, ebx
loop2: cmp [esp+24], edx
jle end
add edx, [esp]
sub edi, eax
cmp edi, 0
jge if2
inc ecx
add edi, ebx
if2: push edi
mov edi, ecx
mov esi, edx
call setPixel
pop edi
jmp loop2

end:
mov edi, [esp+24]
mov esi, [esp+28]
call setPixel
pop edx
pop edx
pop ecx
pop ebx
pop eax
ret

setPixel:
;x in edi und y in esi
push eax
push ebx
push edx
mov eax, 512
mov ebx, esi
mul ebx
add eax, edi ;eax = y*128 + x --> current index
mov bl, 0x00
mov [displayArray+eax], bl
pop edx
pop ebx
pop eax
ret

absvalue:
;first parameter in rdi second in rsi -> erg in rdi
cmp edi, esi
jl signjump
sub edi, esi
ret
signjump:
sub esi,edi
mov edi, esi
ret

clearDisplay:
;clears displayarray
push eax
push ebx
xor eax, eax
clearDisplayloop:
mov ebx, 0xffffffff
mov [displayArray+eax], ebx
add eax, 4
cmp eax, 262144
jl clearDisplayloop
pop ebx
pop eax
ret

;fehler: wenn gerade nach unten
Loading