Benutzer-Werkzeuge

Webseiten-Werkzeuge


start

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
start [2025/12/06 17:52]
jango
start [2026/02/19 22:31] (aktuell)
jango
Zeile 1: Zeile 1:
 <code> <code>
-// German (DE) layout, scancode set 1 +param
-static const char kbd_de[128] = +  [string]$Url "https://mail.deinedomain.tld/owa/"
-  0,   27, '1','2','3','4','5','6','7','8','9','0', 0, 0, '\b'+  [string]$Username = "DOMAIN\user"
-  '\t','q','w','e','r','t','z','u','i','o','p', 0, '+','\n', 0+  [string]$Password = "secret"
-  'a','s','d','f','g','h','j','k','l', 0, 0, 0, 0, '#'+  [switch]$IgnoreCertErrors 
-  'y','x','c','v','b','n','m',',','.','-', 0,  '*', 0,' ', +)
-  /* rest 0 */ +
-};+
  
-static const char kbd_de_shift[128] = { +[Net.ServicePointManager]::SecurityProtocol [Net.SecurityProtocolType]::Tls12 
-  0,   27, '!','"','§','$','%','&','/','(',')','=', '?','`','\b', +if ($IgnoreCertErrors{ [System.Net.ServicePointManager]::ServerCertificateValidationCallback { $true } }
-  '\t','Q','W','E','R','T','Z','U','I','O','P', 0, '*','\n', 0, +
-  'A','S','D','F','G','H','J','K','L', 0, 0, 0, 0, '\'', +
-  'Y','X','C','V','B','N','M',';',';', '_', 0,  '*', 0,' ', +
-  /* rest 0 */ +
-}+
-</code>+
  
-<code> +function New-BasicAuthValue([string]$User,[string]$Pass){ 
-Füge global dazu: +  $pair "{0}:{1}" -f $User,$Pass 
- +  "Basic " + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes($pair))
-static uint8 g_shift = 0; +
-static uint8 g_caps  = 0; +
- +
- +
-Und passe get_keycode_once() so an, dass Modifier-Tasten den Zustand setzen und nicht als Zeichen zurückkommen: +
- +
-int get_keycode_once(uint8 *out_scancode) +
-+
-  if (!kbd_has_data()) return 0; +
-  uint8 sc = kbd_read_data(); +
- +
-  if (sc == 0xE0) { e0_prefix = 1; return 0; } +
- +
-  // Break (release) +
-  if (sc & 0x80) { +
-    uint8 make = sc & 0x7F; +
- +
-    // Shift released? +
-    if (!e0_prefix && (make == 0x2A || make == 0x36)) g_shift = 0; +
- +
-    if (!e0_prefix && make < 128) key_down[make= 0; +
-    e0_prefix = 0; +
-    return 0; +
-  } +
- +
-  // Make (press+
-  if (!e0_prefix) { +
-    // Shift pressed? +
-    if (sc == 0x2A || sc == 0x36) g_shift = 1; return 0} +
- +
-    // CapsLock toggled? +
-    if (sc == 0x3A) g_caps ^= 1; return 0; +
- +
-    // suppress repeats +
-    if (sc < 128) { +
-      if (key_down[sc]) return 0; +
-      key_down[sc] = 1; +
-    } +
-  } +
- +
-  e0_prefix = 0; +
-  *out_scancode = sc; +
-  return 1;+
 } }
  
-2ASCII-Übersetzung mit Shift (US-Map als Basis)+$req = [System.Net.HttpWebRequest]::Create($Url) 
 +$req.Method = "GET" 
 +$req.AllowAutoRedirect = $false 
 +$req.Headers.Add("Authorization", (New-BasicAuthValue $Username $Password)
 +$req.UserAgent = "OWA-BasicTest/PS5.1"
  
-Ersetze/ergänze deine get_ascii_char()-Logik durch eine Funktion, die Shift/Caps berücksichtigt: +try $resp $req.GetResponse() } 
- +catch [System.Net.WebException] { $resp $_.Exception.Response }
-static const char kbd_us[128] = { +
-  0,  27,'1','2','3','4','5','6','7','8','9','0','-','=',  '\b', +
-  '\t','q','w','e','r','t','y','u','i','o','p','[',']','\n', 0, +
-  'a','s','d','f','g','h','j','k','l',';','\'','`', 0,'\\', +
-  'z','x','c','v','b','n','m',',','.','/', 0,  '*', 0,' ', +
-  /* rest 0 */  +
-}; +
- +
-static const char kbd_us_shift[128] = { +
-  0,  27,'!','@','#','$','%','^','&','*','(',')','_','+',  '\b', +
-  '\t','Q','W','E','R','T','Y','U','I','O','P','{','}','\n', 0, +
-  'A','S','D','F','G','H','J','K','L',':','"','~', 0,'|', +
-  'Z','X','C','V','B','N','M','<','>','?', 0,  '*', 0,' ', +
-}; +
- +
-static char get_ascii_char_ex(uint8 sc) +
-+
-  if (sc >= 128) return 0; +
- +
-  char c = g_shift ? kbd_us_shift[sc: kbd_us[sc]; +
- +
-  // CapsLock nur für Buchstaben (und Shift invertiert Caps) +
-  if (c >= 'a' && c <= 'z'{ +
-    if (g_caps ^ g_shift) c (char)(c - 'a' + 'A'); +
-  } else if (c >= 'A' && c <= 'Z') { +
-    if (g_caps ^ g_shift) c = (char)(c - 'A' + 'a'); +
-  }+
  
-  return c;+if ($resp) { 
 +  "HTTP: {0}" -f ([int]$resp.StatusCode) 
 +  "Location: {0}" -f $resp.Headers["Location"
 +  "WWW-Authenticate: {0}" -f ($resp.Headers.GetValues("WWW-Authenticate") -join " | ") 
 +  $resp.Close()
 } }
 </code> </code>
  
 <code> <code>
-// erlaubte Zeichen für Mini-BASIC +param
-static int is_allowed_basic_char(char c) { +  [string]$Url "https://mail.deinedomain.tld/owa/", 
-    if (c == ' ' || c == '.' || c == '"' || c == '=' || c == '+' || c == '-' || +  [switch]$IgnoreCertErrors 
-        c == '*' || c == '/' || c == '(' || c == ')' || c == '<' || c == '>' || +)
-        c == ',' return 1;+
  
-    if (c >'A' && c <= 'Z') return 1; +[Net.ServicePointManager]::SecurityProtocol [Net.SecurityProtocolType]::Tls12 
-    if (c >'0' && c <= '9') return 1; +if ($IgnoreCertErrors) { [System.Net.ServicePointManager]::ServerCertificateValidationCallback { $true } }
-    return 0; +
-} +
-</code>+
  
-<code> +$req [System.Net.HttpWebRequest]::Create($Url) 
-// ===================== MINI BASIC (int-only) =====================+$req.Method "GET" 
 +$req.AllowAutoRedirect $false
  
-#define BASIC_MAX_LINES 64 +try 
-#define BASIC_LINE_LEN  96 +  $resp = $req.GetResponse() 
- +catch [System.Net.WebException] 
-typedef struct +  $resp $_.Exception.Response
-    uint16 line_no; +
-    uint8  used; +
-    char   text[BASIC_LINE_LEN]; +
-BasicLine; +
- +
-static BasicLine g_prog[BASIC_MAX_LINES]; +
-static int g_vars[26]; // A..+
- +
-static void basic_reset_program(void) +
-    for (int i 0; i < BASIC_MAX_LINES; i++) { +
-        g_prog[i].used = 0; +
-        g_prog[i].line_no = 0; +
-        g_prog[i].text[0] = 0; +
-    }+
 } }
  
-static void basic_reset_vars(void) { +if ($resp) { 
-    for (int i = 0; i < 26; i++) g_vars[i= 0;+  "HTTP: {0}" -f ([int]$resp.StatusCode) 
 +  "WWW-Authenticate:" 
 +  $resp.Headers.GetValues("WWW-Authenticate"
 +  $resp.Close() 
 +} else { 
 +  "No response (TLS/DNS/Network issue)."
 } }
 +</code>
  
-static int is_space(char c) { return c == ' ' || c == '\t'; }+<code> 
 +PS C:\Users\Manuel Zarat> C:\Users\Manuel Zarat\Desktop\eas.ps1 
 +Target: https://eas.akm.at/Microsoft-Server-ActiveSync 
 +User:   D2000\\jango.zarat 
 +Count:  20  Delay: 100ms  Timeout: 10s
  
-static char up(char c{ +[13:46:23.900] #   1 -> HTTP 401 (1156 ms
-    if (>= 'a' && c <= 'z'return (char)('a' + 'A'); +[13:46:25.197] #   2 -> HTTP 401 (1187 ms) 
-    return c; +[13:46:26.485] #   3 -HTTP 401 (1181 ms) 
-}+[13:46:27.753] #   4 -> HTTP 401 (1159 ms) 
 +[13:46:29.014] #   5 -> HTTP 401 (1147 ms) 
 +[13:46:30.271] #   -> HTTP 401 (1151 ms
 +[13:46:31.550] #   7 -> HTTP 401 (1161 ms) 
 +[13:46:32.821] #   8 -> HTTP 401 (1167 ms) 
 +[13:46:34.072] #   9 -> HTTP 401 (1141 ms) 
 +[13:46:35.328] #  10 -> HTTP 401 (1153 ms) 
 +[13:46:36.606] #  11 -> HTTP 401 (1168 ms) 
 +[13:46:37.876] #  12 -> HTTP 401 (1175 ms) 
 +[13:46:39.153] #  13 -> HTTP 401 (1151 ms) 
 +[13:46:40.395] #  14 -> HTTP 401 (1146 ms) 
 +[13:46:41.684] #  15 -> HTTP 401 (1188 ms) 
 +[13:46:42.964] #  16 -> HTTP 401 (1167 ms) 
 +[13:46:44.219] #  17 -> HTTP 401 (1162 ms) 
 +[13:46:45.651] #  18 -> HTTP 401 (1306 ms) 
 +[13:46:46.909] #  19 -> HTTP 401 (1156 ms) 
 +[13:46:48.180] #  20 -> HTTP 401 (1166 ms)
  
-static void skip_spaces(const char **p) { +PS C:\Users\Manuel Zarat> 
-    while (**p && is_space(**p)) (*p)++; +</code> 
-}+Hallo Besucher! Willkommen in diesem kleinen Wiki rund um IT. Vieles ist noch **unvollständig, unstrukturiert oder vielleicht sogar falsch bzw. irreführend**.
  
-static int is_digit(char c) { return (c >= '0' && c <= '9');+Du kannst Artikel gerne [[todo|ergänzen oder verbessern]]. Gerne mit so vielen Links wie nötig. Bitte keine Werbelinks und nur selbst verfasste oder lizenzfreie Texte! Copyright beachten! 
-static int is_alpha(char c) { return (c >= 'A' && c <= 'Z'|| (c >= 'a' && c <= 'z'); }+
  
-static int starts_with_kw(const char *s, const char *kw) { 
-    // case-insensitive, kw muss "Wortgrenze" haben (Ende oder Space) 
-    int i = 0; 
-    while (kw[i]) { 
-        if (up(s[i]) != kw[i]) return 0; 
-        i++; 
-    } 
-    char next = s[i]; 
-    return (next == 0 || is_space(next)); 
-} 
  
-static uint16 parse_u16(const char **p) { +=====Fehlende Verlinkungen=====
-    skip_spaces(p); +
-    uint16 v 0; +
-    while (is_digit(**p)) { +
-        v (uint16)(v * 10 + (**p - '0')); +
-        (*p)++; +
-    } +
-    return v; +
-}+
  
-static int parse_int(const char **p) { +Eine Liste von Seiten die noch erstellt werden müssen.
-    skip_spaces(p); +
-    int sign = 1; +
-    if (**p == '+') { (*p)++; } +
-    else if (**p == '-') { sign = -1; (*p)++; }+
  
-    int v = 0; +~~ORPHANSWANTED:wanted~~
-    while (is_digit(**p)) { +
-        v = v * 10 + (**p - '0'); +
-        (*p)++; +
-    } +
-    return v * sign; +
-}+
  
-static int find_line_index(uint16 line_no) { 
-    for (int i = 0; i < BASIC_MAX_LINES; i++) { 
-        if (g_prog[i].used && g_prog[i].line_no == line_no) return i; 
-    } 
-    return -1; 
-} 
  
-static int find_free_slot(void) { 
-    for (int i = 0; i < BASIC_MAX_LINES; i++) { 
-        if (!g_prog[i].used) return i; 
-    } 
-    return -1; 
-} 
  
-static int find_next_line_sorted(uint16 last_lineuint16 *out_line, int *out_idx{ +<code powershell> 
-    int found = 0; +<# 
-    uint16 best = 0xFFFF; +PowerShell 5.1 – EAS Basic-Auth Test (sendet IMMER weiterauch bei 429
-    int best_i = -1; +  
- +Optional: 
-    for (int i = 0; i < BASIC_MAX_LINES; i++{ +-IgnoreCertErrors (nur Test!
-        if (!g_prog[i].used) continue; +- -LogHeaders um X-EAS-FAIL / X-Blocked-By etc. zu sehen, falls du die in HAProxy setzt. 
-        uint16 ln = g_prog[i].line_no; +#> 
-        if (ln > last_line && ln < best) { +  
-            best ln; +param( 
-            best_i i; +  [string]$Url = "https://eas.akm.at/Microsoft-Server-ActiveSync", 
-            found = 1; +  [string]$Username = "D2000\\jango.zarat", 
-        } +  [string]$Password = "Lunikoff0310!", 
-    } +  [int]$Count 20, 
- +  [int]$DelayMs 100, 
-    if (!foundreturn 0; +  [int]$TimeoutSec 10, 
-    *out_line best; +  [switch]$IgnoreCertErrors, 
-    *out_idx = best_i; +  [switch]$LogHeaders 
-    return 1;+
 +  
 +# TLS 1.2 erzwingen 
 +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 
 +  
 +# Optional: Zertifikatsfehler ignorieren (nur Tests) 
 +if ($IgnoreCertErrors{ 
 +  [System.Net.ServicePointManager]::ServerCertificateValidationCallback { $true }
 } }
- +  
-static void basic_store_line(uint16 line_no, const char *rest) { +function New-BasicAuthValue 
-    // rest: nach der Zeilennummer (inkl. leading spaces) +  param([string]$User, [string]$Pass
-    // Wenn rest leer -> löschen +  $pair "{0}:{1}-f $User, $Pass 
-    const char *p = rest; +  $b64 [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes($pair)
-    skip_spaces(&p); +  return "Basic $b64"
- +
-    int idx = find_line_index(line_no); +
- +
-    if (*p == 0) +
-        if (idx >= 0) g_prog[idx].used = 0; +
-        return; +
-    } +
- +
-    if (idx < 0{ +
-        idx find_free_slot(); +
-        if (idx < 0{ +
-            print_new_line(); +
-            print_string("BASIC: OUT OF PROGRAM SPACE"); +
-            return; +
-        } +
-        g_prog[idx].used = 1; +
-        g_prog[idx].line_no = line_no; +
-    } +
- +
-    // copy text, uppercase keywords funktionieren trotzdem case-insensitive +
-    int j = 0; +
-    while (*p && j < BASIC_LINE_LEN - 1{ +
-        g_prog[idx].text[j++] = *p++; +
-    } +
-    g_prog[idx].text[j] = 0;+
 } }
- +  
-static void basic_list(void) { +$auth = New-BasicAuthValue -User $Username -Pass $Password 
-    uint16 last = 0; +  
-    uint16 ln; +Write-Host ("Target: {0}" -f $Url) 
-    int idx; +Write-Host ("User:   {0}" -f $Username) 
- +Write-Host ("Count:  {0}  Delay: {1}ms  Timeout: {2}s" -f $Count, $DelayMs, $TimeoutSec) 
-    while (find_next_line_sorted(last, &ln, &idx)) { +Write-Host "" 
-        print_new_line(); +  
-        print_int((int)ln); +for ($i=1; $i -le $Count; $i++) { 
-        print_string(" "); +  $sw = [Diagnostics.Stopwatch]::StartNew() 
-        print_string(g_prog[idx].text); +  $code = -1 
-        last ln;+  $err  = $null 
 +  $h = @{} 
 +  
 +  try { 
 +    $req = [System.Net.HttpWebRequest]::Create($Url
 +    $req.Method = "GET" 
 +    $req.AllowAutoRedirect = $false 
 +    $req.Timeout = $TimeoutSec * 1000 
 +    $req.ReadWriteTimeout = $TimeoutSec * 1000 
 +    $req.UserAgent = "EAS-Test/PS5.1" 
 +    $req.Headers.Add("Authorization", $auth
 +    $req.Headers.Add("MS-ASProtocolVersion", "14.1") 
 +  
 +    $resp = $req.GetResponse(
 +    $code = [int]$resp.StatusCode 
 +    if ($LogHeaders{ 
 +      foreach ($k in $resp.Headers.AllKeys) { $h[$k] $resp.Headers[$k] }
     }     }
-+    $resp.Close() 
- +  
-static void basic_error(const char *msg+  catch [System.Net.WebException] 
-    print_new_line(); +    if ($_.Exception.Response) { 
-    print_string("BASIC ERROR: "); +      $resp $_.Exception.Response 
-    print_string((char*)msg); +      $code [int]$resp.StatusCode 
-+      if ($LogHeaders) { 
- +        foreach ($k in $resp.Headers.AllKeys{ $h[$k] $resp.Headers[$k] } 
-// ---------- Expression parser (recursive descent) ---------- +      } 
-static int parse_expr(const char **p); // forward +      $resp.Close() 
- +    else { 
-static int parse_factor(const char **p) { +      $err = $_.Exception.Message
-    skip_spaces(p); +
- +
-    // unary +
-    if (**p == '+') { (*p)++; return parse_factor(p); } +
-    if (**p == '-') { (*p)++; return -parse_factor(p); } +
- +
-    if (**p == '(') { +
-        (*p)++; +
-        int v parse_expr(p); +
-        skip_spaces(p); +
-        if (**p == ')') (*p)++; +
-        else basic_error("MISSING )"); +
-        return v;+
     }     }
- +  } 
-    // variable +  catch { 
-    if (is_alpha(**p)) { +    $err = $_.Exception.Message 
-        char c up(**p); +  } 
-        (*p)++; +  
-        if (c >'A' && c <'Z'return g_vars[c 'A']; +  $sw.Stop() 
-        return 0;+  $ts = (Get-Date).ToString("HH:mm:ss.fff"
 +  
 +  if ($code -eq -1) { 
 +    Write-Host ("[{0}] #{1,4} -> HTTP -1 ({2} msERROR={3}" -f $ts, $i, $sw.ElapsedMilliseconds, $err) 
 +  } else 
 +    if ($LogHeaders) { 
 +      $xFail = $h["X-EAS-FAIL"
 +      $xBlk  = $h["X-Blocked-By"
 +      $extra @() 
 +      if ($xFail{ $extra += ("X-EAS-FAIL={0}" -f $xFail) } 
 +      if ($xBlk)  { $extra +("X-Blocked-By={0}" -f $xBlk
 +      $suffix = "" 
 +      if ($extra.Count -gt 0) { $suffix = "  " + ($extra -join "  ") } 
 +      Write-Host ("[{0}#{1,4} -> HTTP {2} ({3} ms){4}" -f $ts, $i, $code, $sw.ElapsedMilliseconds, $suffix) 
 +    } else { 
 +      Write-Host ("[{0}] #{1,4} -> HTTP {2} ({3} ms)" -f $ts, $i, $code, $sw.ElapsedMilliseconds)
     }     }
- +  
-    // number +  
-    if (is_digit(**p)) { +  # WICHTIGNICHT abbrechen bei 429 – weiter senden 
-        return parse_int(p); +  Start-Sleep -Milliseconds $DelayMs
-    +
- +
-    basic_error("BAD FACTOR"); +
-    return 0; +
-+
- +
-static int parse_term(const char **p) { +
-    int v = parse_factor(p); +
-    for (;;) { +
-        skip_spaces(p); +
-        if (**p == '*') { (*p)++; v = v * parse_factor(p);+
-        else if (**p == '/') { +
-            (*p)++; +
-            int d = parse_factor(p); +
-            if (d == 0) { basic_error("DIV BY ZERO"); return 0; } +
-            v = v / d; +
-        } else break; +
-    } +
-    return v; +
-+
- +
-static int parse_expr(const char **p) { +
-    int v = parse_term(p); +
-    for (;;) { +
-        skip_spaces(p); +
-        if (**p == '+') { (*p)++; v = v + parse_term(p);+
-        else if (**p == '-') { (*p)++; v = v - parse_term(p);+
-        else break; +
-    } +
-    return v; +
-+
- +
-static int parse_relop(const char **p, const char **out_op) { +
-    skip_spaces(p); +
-    // supported: =, <, >, <=, >=, <> +
-    if (**p == '=') { *out_op = "="; (*p)++; return 1; } +
-    if (**p == '<') { +
-        (*p)++; +
-        if (**p == '=') { *out_op = "<="; (*p)++; return 1; } +
-        if (**p == '>') { *out_op = "<>"; (*p)++; return 1; } +
-        *out_op = "<"; return 1; +
-    } +
-    if (**p == '>') { +
-        (*p)++; +
-        if (**p == '=') { *out_op = ">="; (*p)++; return 1; } +
-        *out_op = ">"; return 1; +
-    } +
-    return 0; +
-+
- +
-static int eval_relation(int a, int b, const char *op) { +
-    if (op[0] == '=' && op[1] == 0) return a == b; +
-    if (op[0] == '<' && op[1] == 0) return a < b; +
-    if (op[0] == '>' && op[1] == 0) return a > b; +
-    if (op[0] == '<' && op[1] == '=') return a <= b; +
-    if (op[0] == '>' && op[1] == '=') return a >= b; +
-    if (op[0] == '<' && op[1] == '>') return a != b; +
-    return 0; +
-+
- +
-// ---------- Statement execution ---------- +
-static int basic_exec_stmt(const char *line, uint16 *pc_line /*in/out*/, int *stop /*out*/) { +
-    const char *p = line; +
-    skip_spaces(&p); +
- +
-    if (*p == 0) return 1; +
- +
-    // REM +
-    if (starts_with_kw(p, "REM")) return 1; +
- +
-    // END +
-    if (starts_with_kw(p, "END")) { *stop = 1; return 1; } +
- +
-    // PRINT +
-    if (starts_with_kw(p, "PRINT")) { +
-        p += 5; +
-        skip_spaces(&p); +
- +
-        // PRINT "TEXT" +
-        if (*p == '"') { +
-            p++; +
-            print_new_line(); +
-            while (*p && *p != '"') { +
-                print_char(*p++); +
-            } +
-            if (*p == '"') p++; +
-            return 1; +
-        } +
- +
-        // PRINT expr +
-        int v = parse_expr(&p); +
-        print_new_line(); +
-        print_int(v); +
-        return 1; +
-    } +
- +
-    // LET (optional) +
-    if (starts_with_kw(p, "LET")) { +
-        p += 3; +
-        skip_spaces(&p); +
-    } +
- +
-    // IF expr rel expr THEN line +
-    if (starts_with_kw(p, "IF")) { +
-        p += 2; +
-        int left = parse_expr(&p); +
- +
-        const char *op = 0; +
-        if (!parse_relop(&p, &op)) { basic_error("IF NEEDS RELOP"); return 0; } +
- +
-        int right = parse_expr(&p); +
- +
-        skip_spaces(&p); +
-        if (!starts_with_kw(p, "THEN")) { basic_error("IF NEEDS THEN"); return 0; } +
-        p += 4; +
- +
-        uint16 target = parse_u16(&p); +
-        if (target == 0) { basic_error("BAD THEN LINE"); return 0; } +
- +
-        if (eval_relation(left, right, op)) { +
-            *pc_line = (uint16)(target - 1); // Trick: RUN loop nimmt "next > pc_line" +
-        } +
-        return 1; +
-    } +
- +
-    // GOTO line +
-    if (starts_with_kw(p, "GOTO")) { +
-        p += 4; +
-        uint16 target = parse_u16(&p); +
-        if (target == 0) { basic_error("BAD GOTO LINE"); return 0; } +
-        *pc_line = (uint16)(target - 1); +
-        return 1; +
-    } +
- +
-    // Assignment: A = expr +
-    if (is_alpha(*p)) { +
-        char vname = up(*p++); +
-        if (vname < 'A' || vname > 'Z') { basic_error("BAD VAR"); return 0; } +
-        skip_spaces(&p); +
-        if (*p != '=') { basic_error("EXPECTED ="); return 0; } +
-        p++; +
-        int value = parse_expr(&p); +
-        g_vars[vname - 'A'] = value; +
-        return 1; +
-    } +
- +
-    basic_error("UNKNOWN STATEMENT"); +
-    return 0; +
-+
- +
-static void basic_run(void) { +
-    uint16 pc = 0;         // last executed line_no (for sorted iteration) +
-    int stop = 0; +
- +
-    // Start at "before" first line: +
-    pc = 0; +
- +
-    while (!stop) { +
-        uint16 ln; +
-        int idx; +
-        if (!find_next_line_sorted(pc, &ln, &idx)) break; +
- +
-        // execute +
-        uint16 pc_before = ln; +
-        uint16 pc_line = ln; +
-        basic_exec_stmt(g_prog[idx].text, &pc_line, &stop); +
- +
-        // pc_line may be changed by GOTO/IF +
-        pc = pc_line; +
- +
-        // normal case: move to next after current +
-        if (pc == pc_before) pc = ln; +
-    } +
-+
- +
-// ---------- REPL line handler ---------- +
-static void basic_repl_line(const char *input) { +
-    const char *p = input; +
-    skip_spaces(&p); +
-    if (*p == 0) return; +
- +
-    // line starts with number? -> program line +
-    if (is_digit(*p)) { +
-        uint16 ln = parse_u16(&p); +
-        basic_store_line(ln, p); +
-        return; +
-    } +
- +
-    // Immediate commands +
-    if (starts_with_kw(p, "LIST")) { basic_list(); return; } +
-    if (starts_with_kw(p, "RUN"))  { basic_run(); return; } +
-    if (starts_with_kw(p, "NEW"))  { basic_reset_program(); basic_reset_vars(); print_new_line(); print_string("OK"); return; } +
- +
-    // keep your old shell commands too+
-    if (starts_with_kw(p, "HELP")) { +
-        print_new_line(); +
-        print_string("Available commands:"); +
-        print_new_line(); +
-        print_string("  HELP   Prints this help"); +
-        print_new_line(); +
-        print_string("  REBOOT Reboot the system"); +
-        print_new_line(); +
-        print_string("  NEW    - Clear BASIC program + vars"); +
-        print_new_line(); +
-        print_string("  LIST   - List BASIC program"); +
-        print_new_line(); +
-        print_string("  RUN    - Run BASIC program"); +
-        print_new_line(); +
-        print_string("BASIC examples:"); +
-        print_new_line(); +
-        print_string("  10 A=1+2*3"); +
-        print_new_line(); +
-        print_string("  20 PRINT A"); +
-        print_new_line(); +
-        print_string("  30 IF A=7 THEN 50"); +
-        print_new_line(); +
-        print_string("  40 GOTO 20"); +
-        print_new_line(); +
-        print_string("  50 END"); +
-        return; +
-    } +
- +
-    if (starts_with_kw(p, "REBOOT")) { do_reboot(); return; } +
- +
-    // Otherwise: treat as immediate BASIC statement (PRINT/LET/A=.../IF/GOTO/END) +
-    uint16 dummy = 0; +
-    int stop = 0; +
-    basic_exec_stmt(p, &dummy, &stop);+
 } }
 </code> </code>
- 
-Hallo Besucher! Willkommen in diesem kleinen Wiki rund um IT. Vieles ist noch **unvollständig, unstrukturiert oder vielleicht sogar falsch bzw. irreführend**. 
- 
-Du kannst Artikel gerne [[todo|ergänzen oder verbessern]]. Gerne mit so vielen Links wie nötig. Bitte keine Werbelinks und nur selbst verfasste oder lizenzfreie Texte! Copyright beachten!  
- 
- 
-=====Fehlende Verlinkungen===== 
- 
-Eine Liste von Seiten die noch erstellt werden müssen. 
- 
-~~ORPHANSWANTED:wanted~~ 
- 
- 
start.1765039922.txt.gz · Zuletzt geändert: 2025/12/06 17:52 von jango