Hirdetés
- gban: Ingyen kellene, de tegnapra
- GoodSpeed: A RAM-válság és annak lehetséges hatásai
- sziku69: Szólánc.
- D@reeo: Pi-hole és a Telekom Sagemcom F@st 5670 DNS beállítása
- sziku69: Fűzzük össze a szavakat :)
- ubyegon2: Airfryer XL XXL forrólevegős sütő gyakorlati tanácsok, ötletek, receptek
- Luck Dragon: Asszociációs játék. :)
- Gurulunk, WAZE?!
- eBay-es kütyük kis pénzért
- Luck Dragon: MárkaLánc
Új hozzászólás Aktív témák
-
ZTE_luky
senior tag
Köszönöm szépen a segítséget, hát igen no [] tömböm random meg van határozva, de annál kevesebb értéket is kivehet mint a max, többet nem. Nem tudom az mennyire lehet probléma. Jelenleg se történik semmi, valami ilyesmit kellett kihozni az egészből 14:00-kor kell leadnom, de nem működik, tele van warning-al és nem is csinál semmi értelmeset sajnos. PEdig a kiinduló C-file gyönyörűen működik. Nem tudom mi lehet a baj, eléggé belekeveredtem sajnos.
#include<stdio.h>
#include<string.h>
// ---------- Globale Variablen ----------
int no[] = {0x0F,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,
0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20,0x21,0x22,
0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B};
// Address array
char string[9]; // String array
int R0; // (--int halt--) 0 Constant
int R1;
int R2; // (--int counter--) Index counter (String)
int R3; // (--int op--) Index Operation-Code
int R4; // (--int state--) Index strings
int R5; // (--int i--) Index counter (Address)
char R6; // (--char c--) Character to getchar
char R7; // (--char r1--) Register 1
char R8; // (--char r2--) Register 2
char R9; // (--char r3--) Register 3
int *RA; // (--int *no0--) BP of Address-array NEW
int *RB; // (--int *noi--) Flexibe Array Pointer NEW
char *RC; // (--char *string0--) BP of String-array NEW
char *RD; // (--char stringi--) Flexibe Array Pointer NEW
int RE; // SIZE 9
int RF; // FFFF
// ---------- Main Function ----------
int main()
{
R0 = 0;
R1 = 1;
R2 = 0;
R4 = 0;
R5 = 0;
RA = &no[0];
RC = &string[0];
RE = 9;
RF = 0xFFFF;
//no0 = &no[R0]; // Zero Element (in array "no") NEW
//string0 = &string[R0]; // Zero Element (in array "string") NEW
// ---------- Program ----------
L0: //init
R2 = R0; //counter
goto L1; //thestring;
L1: //thestring:
if (R2 < RE) // for (counter = 0; counter < 9 ;)
R6 = getchar(); //c
if ( R6 != EOF) //c
goto L2; //ignore;
else {goto L3;} //end
L2: //ignore:
if (R6 != 0x20 && R6 != 0xA) // R6=c
{
R2 += R1; //counter++;
//o++;
goto L1; //thestring;
}
// ---------- Search Function (Operating Code) ----------
// if (string[0] == 0x41 && string[1] == 0x44 && string[2] == 0x44)
if (*RC == 0x41 && *RC + R1 == 0x44 && *RC + R1 + R1 == 0x44) //NEW
{ //----- Function ADD -----
R3 = R1;
R4 += R1;
RB += R1;
R7 = RC + R1 * 4;
R8 = RC + R1 * 6;
R9 = RC + R1 * 8;
printf("%D:%d%c%c%c\n",RB,R3,R7,R8,R9); //Print the current string
}
//else if (string[0] == 0x53 && string[1] == 0x55 && string[2] == 0x42)
else if (*RC == 0x53 && *RC + R1 == 0x55 && *RC + R1 + R1 == 0x42)//NEW
{ //----- Function SUB -----
R3 = R1;
R4 += R1;
RB += R1;
R7 = RC + R1 * 4;
R8 = RC + R1 * 6;
R9 = RC + R1 * 8;
printf("%D:%d%c%c%c\n",RB,R3,R7,R8,R9); //Print the current string
}
//else if (string[0] == 0x41 && string[1] == 0x4E && string[2] == 0x44)
else if (*RC == 0x41 && *RC + R1 == 0x4E && *RC + R1 + R1 == 0x44) //NEW
{ //----- Function AND -----
R3 = R1;
R4 += R1;
RB += R1;
R7 = RC + R1 * 4;
R8 = RC + R1 * 6;
R9 = RC + R1 * 8;
printf("%D:%d%c%c%c\n",RB,R3,R7,R8,R9); //Print the current string
}
//else if (string[0] == 0x58 && string[1] == 0x4F && string[2] == 0x52)
else if (*RC == 0x58 && *RC + R1 == 0x4F && *RC + R1 + R1 == 0x52) //NEW
{ //----- Function XOR -----
R3 = R1;
R4 += R1;
RB += R1;
R7 = RC + R1 * 4;
R8 = RC + R1 * 6;
R9 = RC + R1 * 8;
printf("%D:%d%c%c%c\n",RB,R3,R7,R8,R9); //Print the current string
}
//else if (string[0] == 0x53 && string[1] == 0x48 && string[2] == 0x4C)
else if (*RC == 0x53 && *RC + R1 == 0x48 && *RC + R1 + R1 == 0x4C) //NEW
{ //----- Function SHL -----
R3 = R1;
R4 += R1;
RB += R1;
R7 = RC + R1 * 4;
R8 = RC + R1 * 6;
R9 = RC + R1 * 8;
printf("%D:%d%c%c%c\n",RB,R3,R7,R8,R9); //Print the current string
}
//else if (string[0] == 0x53 && string[1] == 0x48 && string[2] == 0x52)
else if (*RC == 0x53 && *RC + R1 == 0x48 && *RC + R1 + R1 == 0x52) //NEW
{ //----- Function SHR -----
R3 = R1;
R4 += R1;
RB += R1;
R7 = RC + R1 * 4;
R8 = RC + R1 * 6;
R9 = RC + R1 * 8;
printf("%D:%d%c%c%c\n",RB,R3,R7,R8,R9); //Print the current string
}
//else if (string[0] == 0x48 && string[1] == 0x4C && string[2] == 0x54)
else if (*RC == 0x48 && *RC + R1 == 0x4C && *RC + R1 + R1 == 0x54) //NEW
{ //----- Function HLT -----
R3 = R1;
R4 += R1;
RB += R1;
R7 = RC + R1 * 4;
R8 = RC + R1 * 6;
R9 = RC + R1 * 8;
printf("%D:%d%d%d%d\n",RB,R0,R0,R0,R0); //Print the current string
}
else printf("%04X\n", RF); //Print FFFF when it's an incorrct Value
goto L0; //init;
L3: //end
return 0;
}
Új hozzászólás Aktív témák
● olvasd el a téma összefoglalót!
● ha kódot szúrsz be, használd a PROGRAMKÓD formázási funkciót!
- Közvetve bedarálja az AI a Switch 2 tárhelyét
- Hálózati / IP kamera
- Samsung Galaxy S21 FE 5G - utóirat
- Otthoni IPTV megvalósítási lehetőségek?
- Gumi és felni topik
- Mennyibe fog kerülni a Steam Machine?
- gban: Ingyen kellene, de tegnapra
- Szünetmentes tápegységek (UPS)
- Flint 2 OFF topik
- Arc Raiders
- További aktív témák...
- Eladó erős 1080p Gamer konfig Gamer monitorral
- LG 83G4 - 65" OLED evo - 4K 144Hz & 0.1ms - MLA Plus - 3000 Nits - NVIDIA G-Sync - FreeSync Premium
- Apple Airpods Pro 2 megkímèlt ligtning csatis
- LG 39GX90SA-W - 39" Ívelt Smart OLED/ WQHD 2K / 240Hz & 0.03ms / 1300 Nits / G-Sync & FreeSync
- LG 27US550-W - 27" IPS / 3840x2160 4K / 60Hz 5ms / HDR10 / Forgatható / sRGB 99%
- Bomba ár! Lenovo V155-15API - Ryzen 5 I 8GB I 512SSD I 15,6" FHD I Radeon I HDMI I Cam I W11 I Gari
- Thinkpad L13 Yoga i5-10210U 16GB 1000GB 13.3", Touch gyári magyar világítós bill 360 Gar.: 1év
- iKing.Hu - Apple iPhone 15 Pro Max Black Titanium Titán stílus, 5 optikai zoom 256 GB- Gari
- 145 - Lenovo Legion Pro 7 (16IRX9H) - Intel Core i9-14900HX, RTX 4090 (ELKELT)
- REFURBISHED és ÚJ - HP USB-C/A Universal Dock G2 (5TW13AA) (DisplayLink)
Állásajánlatok
Cég: ATW Internet Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest

