Skip to content

Commit

Permalink
Initial nVidia disassembler
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Aug 22, 2024
1 parent 8a5522b commit f42772d
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ objects := be.o editor.o \
arch/ppc/ppc_disasm.o \
arch/m68k/dis68k.o \
arch/sh4/sh4.o \
arch/nv/nv.o \
arch/mips/mips-rsp.o \
arch/pdp11/pdp11.o
.PHONY: all
Expand Down
32 changes: 32 additions & 0 deletions arch/nv/nv.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (c) Namdak Tonpa
// nVidia G80 SM89

#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>

#include "../../editor.h"

uint64_t NVword(unsigned long int address) {
uint64_t operation = (uint64_t)*((unsigned long int *)address);
return operation;
}

char nvout[1000];

char *decodeNV(unsigned long int address, char *outbuf, int *lendis, unsigned long int offset0)
{
struct editor *e = editor();
unsigned long int start = address, i;
unsigned long int finish = address + 2;
uint64_t operation = NVword(start);
for (i = 0; i < 1000; i++) nvout[i] = 0;

if (operation == 0) { sprintf(nvout, "%s ", ""); }

memcpy(outbuf,nvout,strlen(nvout));
outbuf[strlen(nvout)] = '\0';
*lendis = finish - start;
return outbuf;
}
20 changes: 20 additions & 0 deletions arch/nv/nvidia.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

Maxwell Volta Turing Ampere Hopper
Pascal Ada

▶ RX x x x x x
▶ SRX x x x x x
▶ PX x x x x x
▶ c[X][Y] x x x x x
▶ URX - - x x x
▶ UPX - - - x x
▶ desc[URX][RY] - - - - x


GM100 Maxwell
GP100 Pascal
TU100 Turing
GV100 Volta
GA100 Ampere
G80/G84/G86/G92/G94/G96/G98 Tesla
AD100 Ada

0 comments on commit f42772d

Please sign in to comment.